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. Dynamic Q_PROPERTY Read / Write function ?
Qt 6.11 is out! See what's new in the release blog

Dynamic Q_PROPERTY Read / Write function ?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 1.6k Views
  • 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.
  • M Offline
    M Offline
    MHermann
    wrote on last edited by
    #1

    Hi!

    I have created some dynamic properties in my C++ class.
    Is it possible to read the value of such a dynamic property from qml?
    In qml I get noticed if the dynamic properties change, because of the onPropertyChanged signal.
    But I want to read the value of a dynamic property once when the qml componentd was created (Component.onCompleted).
    Has anyone an idea how I can do this?

    Kind regards,
    MHermann

    1 Reply Last reply
    0
    • 6thC6 Offline
      6thC6 Offline
      6thC
      wrote on last edited by
      #2

      Pretty sure that will show you what you need.
      http://doc.qt.io/qt-5/qtqml-tutorials-extending-qml-example.html

      You can also jump straight into code and start tinkering - it's an example application. Just go to the Qt Creator welcome screen, examples and search "Writing QML Extensions with C++"

      M 1 Reply Last reply
      0
      • 6thC6 6thC

        Pretty sure that will show you what you need.
        http://doc.qt.io/qt-5/qtqml-tutorials-extending-qml-example.html

        You can also jump straight into code and start tinkering - it's an example application. Just go to the Qt Creator welcome screen, examples and search "Writing QML Extensions with C++"

        M Offline
        M Offline
        MHermann
        wrote on last edited by
        #3

        @6thC: Thanks for the hint.

        I solved my problem by calling a C++ function which was made available by Q_INVOKABLE. In this function I am fetching and returning the requested data to the qml.

        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