main.cpp 687 B

1234567891011121314151617181920212223242526272829303132
  1. #include <QtGui/QApplication>
  2. #include "qmlapplicationviewer.h"
  3. #include <QList>
  4. #include <QByteArray>
  5. #include <QSensor>
  6. QTM_USE_NAMESPACE
  7. #include <QDebug>
  8. #include "skyview.h"
  9. int main(int argc, char *argv[])
  10. {
  11. QApplication app(argc, argv);
  12. qmlRegisterType<SkyView>("StarMap", 1, 0, "SkyView");
  13. QmlApplicationViewer viewer;
  14. viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
  15. viewer.setMainQmlFile(QLatin1String("qml/starmap/main.qml"));
  16. viewer.showFullScreen();
  17. QList<QByteArray> types = QSensor::sensorTypes();
  18. Q_FOREACH(QString type, types) {
  19. qDebug() << "Sensor type found:" << type;
  20. }
  21. return app.exec();
  22. }