Advertisement
Guest User

Untitled

a guest
Nov 24th, 2013
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.89 KB | None | 0 0
  1. int main(int argc, char *argv[])
  2. {
  3.     // SailfishApp::main() will display "qml/template.qml", if you need more
  4.     // control over initialization, you can use:
  5.     //
  6.     //   - SailfishApp::application(int, char *[]) to get the QGuiApplication *
  7.     //   - SailfishApp::createView() to get a new QQuickView * instance
  8.     //   - SailfishApp::pathTo(QString) to get a QUrl to a resource file
  9.     //
  10.     // To display the view, call "show()" (will show fullscreen on device).
  11.  
  12.     QGuiApplication *app = SailfishApp::application(argc, argv);
  13.     QQuickView *view = SailfishApp::createView();
  14.  
  15.     view->setSource(SailfishApp::pathTo("HelloSailfish.qml"));
  16.     view->show();
  17.  
  18.     QObject *rootObject = view->rootObject();
  19.  
  20.     QQmlProperty answerProperty(rootObject, "answer");
  21.  
  22.     qDebug() << "answer = " << answerProperty.read();
  23.     answerProperty.write(42);
  24.  
  25.     return app->exec();
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement