We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c9ed0a9 commit 0b60feeCopy full SHA for 0b60fee
1 file changed
src/qt-mbnavedit/main.cpp
@@ -55,14 +55,13 @@ int main(int argc, char *argv[]) {
55
QQmlApplicationEngine engine;
56
57
GuiNames guiNames;
58
- QQmlContext *context = engine.rootContext();
59
- context->setContextProperty("GuiNames", &guiNames);
+
+ QVariantMap initialProps;
60
+ initialProps.insert("backend", QVariant::fromValue(&backend));
61
+ initialProps.insert("guiNames", QVariant::fromValue(&guiNames));
62
63
// Make backend object and methods accessible to QML
- engine.setInitialProperties({
- { "backend", QVariant::fromValue(&backend) }
64
- });
65
-
+ engine.setInitialProperties(initialProps);
66
67
// Boilerplate...
68
const QUrl url(QStringLiteral("qrc:/main.qml"));
0 commit comments