fix build with scanner

This commit is contained in:
MoroccanMalinois 2017-03-03 02:39:49 +00:00
parent e826f7c1ec
commit 8c17a8c388
No known key found for this signature in database
GPG key ID: A63BDCF76B8B38BD

View file

@ -182,6 +182,10 @@ int main(int argc, char *argv[])
engine.rootContext()->setContextProperty("defaultAccountName", accountName);
engine.rootContext()->setContextProperty("applicationDirectory", QApplication::applicationDirPath());
// Load main window (context properties needs to be defined obove this line)
engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
QObject *rootObject = engine.rootObjects().first();
bool builtWithScanner = false;
#ifdef WITH_SCANNER
builtWithScanner = true;
@ -192,10 +196,6 @@ int main(int argc, char *argv[])
#endif
engine.rootContext()->setContextProperty("builtWithScanner", builtWithScanner);
// Load main window (context properties needs to be defined obove this line)
engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
QObject *rootObject = engine.rootObjects().first();
QObject::connect(eventFilter, SIGNAL(sequencePressed(QVariant,QVariant)), rootObject, SLOT(sequencePressed(QVariant,QVariant)));
QObject::connect(eventFilter, SIGNAL(sequenceReleased(QVariant,QVariant)), rootObject, SLOT(sequenceReleased(QVariant,QVariant)));
QObject::connect(eventFilter, SIGNAL(mousePressed(QVariant,QVariant,QVariant)), rootObject, SLOT(mousePressed(QVariant,QVariant,QVariant)));