Change QML item property in c++ code
-
Hi
Its described here
http://doc.qt.io/qt-5/qtqml-cppintegration-interactqmlfromcpp.htmlI think you are looking for the section with
QQuickItem item = qobject_cast<QQuickItem>(object); -
Hi,
ok I found it. That meens that I have to create a new QQuickItem for every item, which I want to change it?
I want to change a item with a id, so I think I need this one?
@
QObject rect = object->findChild<QObject>("rect");
if (rect)
rect->setProperty("color", "red");
@BR
martin -
Hi,
ok I found it. That meens that I have to create a new QQuickItem for every item, which I want to change it?
I want to change a item with a id, so I think I need this one?
@
QObject rect = object->findChild<QObject>("rect");
if (rect)
rect->setProperty("color", "red");
@BR
martin