Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How I can change anhors property from C++?
Forum Updated to NodeBB v4.3 + New Features

How I can change anhors property from C++?

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 588 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • shavS Offline
    shavS Offline
    shav
    wrote on last edited by
    #1

    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!

    Mac OS and iOS Developer

    1 Reply Last reply
    0
    • GianlucaG Offline
      GianlucaG Offline
      Gianluca
      wrote on last edited by
      #2

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

      @
      QQmlProperty anchorTopMargin(qmlObject, "anchors.topMargin");
      anchorsTopMargin.write(45);
      @

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved