Change property value from c++
-
Hi guys i need some help.
How to change QML property value from c++ ?
//main.cpp QQmlContext *ctx = engine.rootContext(); ctx->setContextProperty("control",&allofthem); ctx->setProperty("text","Qt Everywhere"); engine.load(QUrl(QStringLiteral("qrc:/main.qml")));//main.qml property string text . . . console.log(text)Result

-
When are you printing the text? Use
onTextChangedsignal handler and print the text there. -
Can you post your QML file ?