Advertisement
Guest User

Untitled

a guest
Dec 29th, 2013
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.25 KB | None | 0 0
  1.  
  2. #ifdef QT_QML_DEBUG
  3. #include <QtQuick>
  4. #endif
  5.  
  6. #include <QtQuick>
  7.  
  8. #include <sailfishapp.h>
  9. #include "thumbnailprovider.h"
  10. #include "settings.h"
  11. #include "filelist.h"
  12.  
  13.  
  14. int main(int argc, char *argv[])
  15. {
  16.     // SailfishApp::main() will display "qml/template.qml", if you need more
  17.     // control over initialization, you can use:
  18.     //
  19.     //   - SailfishApp::application(int, char *[]) to get the QGuiApplication *
  20.     //   - SailfishApp::createView() to get a new QQuickView * instance
  21.     //   - SailfishApp::pathTo(QString) to get a QUrl to a resource file
  22.     //
  23.     // To display the view, call "show()" (will show fullscreen on device).
  24.  
  25.     QGuiApplication *app = SailfishApp::application(argc, argv);
  26.     QQuickView *view = SailfishApp::createView();
  27.  
  28.     // Add image providers and C++ classes
  29.     view->engine()->addImageProvider(QLatin1String("thumbnail"), new ThumbnailProvider);
  30.  
  31.     FileList fileList;
  32.     view->engine()->rootContext()->setContextProperty("fileList", &fileList);
  33.  
  34.     Settings settings;
  35.     view->engine()->rootContext()->setContextProperty("settings", &settings);
  36.  
  37.     // Show the application
  38.     view->setSource(SailfishApp::pathTo("qml/MediaViewer.qml"));
  39.     view->show();
  40.  
  41.     return app->exec();
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement