Hey hey
I have to pass settings from C++ code to QML , so I have two ways to go either using context
QtQuick2ApplicationViewer viewer;
WindowSettings windowSettings;
viewer.rootContext()->setContextProperty(QStringLiteral("settings"), &windowSettings);
or like this
qmlRegisterSingletonType<WindowSettings>(SETTINGS_URI, 1, 0, "Settings", settingsPovider);
Just curious, what is the better approach?
↧








