Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Registering Singleton vs Context Property

$
0
0
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?

Viewing all articles
Browse latest Browse all 4972

Latest Images

Trending Articles



Latest Images