[app] Set context properties prior to loading QML

This commit is contained in:
Slava Monich 2015-08-18 17:37:34 +03:00
parent f30d83bf39
commit 7042dbff79

View file

@ -166,14 +166,13 @@ void ZLibrary::run(ZLApplication* aApp)
HDEBUG("qml file" << qPrintable(qml)); HDEBUG("qml file" << qPrintable(qml));
QQuickView* view = SailfishApp::createView(); QQuickView* view = SailfishApp::createView();
view->setSource(QUrl::fromLocalFile(qml));
QQmlContext* root = view->rootContext(); QQmlContext* root = view->rootContext();
root->setContextProperty("PointsPerInch", BOOKS_PPI); root->setContextProperty("PointsPerInch", BOOKS_PPI);
root->setContextProperty("MaximumHintCount", 1); root->setContextProperty("MaximumHintCount", 1);
root->setContextProperty("DoubleClickInterval", root->setContextProperty("DoubleClickInterval",
qApp->styleHints()->mouseDoubleClickInterval()); qApp->styleHints()->mouseDoubleClickInterval());
view->setSource(QUrl::fromLocalFile(qml));
view->show(); view->show();
HDEBUG("started"); HDEBUG("started");
qApp->exec(); qApp->exec();