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");
    anchorsTopMargin.write(45);
    @


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.