main.cpp 560 B

123456789101112131415161718192021
  1. #include <QtGui/QApplication>
  2. #include <QDeclarativeEngine>
  3. #include <QDebug>
  4. #include "qmlapplicationviewer.h"
  5. Q_DECL_EXPORT int main(int argc, char *argv[])
  6. {
  7. QScopedPointer<QApplication> app(createApplication(argc, argv));
  8. QmlApplicationViewer viewer;
  9. viewer.engine()->addImportPath( "qml\\CommunityModule" );
  10. qDebug() << "import path list:" << viewer.engine()->importPathList();
  11. viewer.setMainQmlFile(QLatin1String("qml/CommunityComponentsDemo/main.qml"));
  12. viewer.showExpanded();
  13. return app->exec();
  14. }