Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Problems with QML Bindings
-
Hi! I have a class with a QVariantMap property which contains a color scheme. I use Q_PROPERTY. I set colors like
color: style.win_background;
. Thestyle
declaration:property var style: theme.data;
onStyleChanged: { console.log("Changed"); }
When I change the win_background property ofstyle
I get in console the message:qml: Changed
but the window color is not changed. What I am doing wrong?
-
Try calling styleChanged() after modifying style.
-
Thanks! I fix the problem. All works fine, but I have a Rectangle over that hide the window background and that was the problem.