summaryrefslogtreecommitdiff
path: root/examples/sensors/sensor_explorer/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/sensors/sensor_explorer/main.cpp')
-rw-r--r--examples/sensors/sensor_explorer/main.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/examples/sensors/sensor_explorer/main.cpp b/examples/sensors/sensor_explorer/main.cpp
index 34f5ba3..066f559 100644
--- a/examples/sensors/sensor_explorer/main.cpp
+++ b/examples/sensors/sensor_explorer/main.cpp
@@ -38,5 +38,27 @@
**
****************************************************************************/
-#include "../stub.h"
-SENSORS_EXAMPLE_MAIN(sensor_explorer)
+#include <QtQml>
+#include <QtQuick/QQuickWindow>
+
+#ifndef QT_NO_WIDGETS
+#include <QtWidgets/QApplication>
+#define Application QApplication
+#else
+#include <QtGui/QGuiApplication>
+#define Application QGuiApplication
+#endif
+
+int main(int argc, char *argv[])
+{
+ Application app(argc, argv);
+ QQmlApplicationEngine engine(QUrl("qrc:///sensor_explorer.qml"));
+ QObject *topLevel = engine.rootObjects().value(0);
+ QQuickWindow *window = qobject_cast<QQuickWindow *>(topLevel);
+ if (!window) {
+ qWarning("Error: Your root item has to be a Window.");
+ return -1;
+ }
+ window->show();
+ return app.exec();
+}