mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-10 21:04:32 +00:00
main: do not crash if we can't load some stuff
This happens with some Qt widgets/components aren't found
This commit is contained in:
parent
986275c42c
commit
f45b0a7d25
1 changed files with 10 additions and 0 deletions
10
main.cpp
10
main.cpp
|
@ -255,7 +255,17 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
// Load main window (context properties needs to be defined obove this line)
|
// Load main window (context properties needs to be defined obove this line)
|
||||||
engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
|
engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
|
||||||
|
if (engine.rootObjects().isEmpty())
|
||||||
|
{
|
||||||
|
qCritical() << "Error: no root objects";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
QObject *rootObject = engine.rootObjects().first();
|
QObject *rootObject = engine.rootObjects().first();
|
||||||
|
if (!rootObject)
|
||||||
|
{
|
||||||
|
qCritical() << "Error: no root objects";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef WITH_SCANNER
|
#ifdef WITH_SCANNER
|
||||||
QObject *qmlCamera = rootObject->findChild<QObject*>("qrCameraQML");
|
QObject *qmlCamera = rootObject->findChild<QObject*>("qrCameraQML");
|
||||||
|
|
Loading…
Reference in a new issue