main.cpp 602 B

1234567891011121314151617181920212223242526
  1. #include<QApplication>
  2. #include<QtDeclarative>
  3. #include<QDeclarativeEngine>
  4. #include<QObject>
  5. #include<QGLWidget>
  6. #include "applicationstarter.h"
  7. int main(int argc,char **argv) {
  8. QApplication app(argc,argv);
  9. //Register type
  10. qmlRegisterType<ApplicationStarter>("ApplicationStarter",1,0,"Starter");
  11. QDeclarativeView *view = new QDeclarativeView();
  12. //Enable OpenGL
  13. view->setViewport(new QGLWidget());
  14. view->setResizeMode(QDeclarativeView::SizeRootObjectToView);
  15. view->setSource(QUrl("qrc:/applicationList.qml"));
  16. view->showFullScreen();
  17. return app.exec();
  18. }