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. Send data from C++ to Qml
Forum Updated to NodeBB v4.3 + New Features

Send data from C++ to Qml

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 280 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.
  • D Offline
    D Offline
    dziko147
    wrote on last edited by
    #1

    Hello , i am really new in Qt development
    Can anyone explain me how can i send data from c++ to my Qml file .
    Ps: I displayed my Qml in Qquickwidget
    Any help will be appreciated

    1 Reply Last reply
    0
    • M Offline
      M Offline
      make2
      wrote on last edited by make2
      #2

      https://doc.qt.io/qt-5/qtqml-cppintegration-exposecppattributes.html
      https://doc.qt.io/qt-5/qtqml-cppintegration-overview.html#:~:text=Overview - QML and C%2B%2B Integration QML is,C%2B%2B functionality to be invoked directly from QML.

      create a class extends QObject

      use Q_PROPERTY, Q_INVOKE ... to expose attribute to qml

      create a instance of this type

      rootObject setContentProperties() in main.cpp

      then you can use this instance, in rootObject qml

      1 Reply Last reply
      1

      • Login

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