Important: Please read the Qt Code of Conduct -

How I can change anhors property from C++?

  • Hi everyone!

    I have a QQuickPainterItem object in C++. This object has a field as a QML component which I need to change anchors property. How I can do this from C++ in documentation and search I can't find any information about this.

    Thanks for the any help!

  • Use QQmlProperty (:-P see the documentation ;-) )

    QQmlProperty anchorTopMargin(qmlObject, "anchors.topMargin");

Log in to reply