Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Signalling to QML based on 'id'

    QML and Qt Quick
    2
    2
    75
    Loading More Posts
    • 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.
    • V
      Vyuvaraj last edited by

      Hi All,

      I have a Layout QML file which has several other nested sub-layout QMLs.
      I have created a main.qml file, inside which I create two instances of Layout QML say "left" and "right".
      I have two tcp client application which receives data from two different sources.
      All I need to do is receive data from tcp client and signal it to the respective Layout QML.

      Is there a way that I could use the QML 'id' and signal via my cpp program.
      I have already referred topics: https://doc.qt.io/qt-5/qtqml-cppintegration-topic.html
      https://doc.qt.io/qt-5/qtqml-cppintegration-topic.html and https://doc.qt.io/qt-5/qtqml-cppintegration-interactqmlfromcpp.html#connecting-to-qml-signals

      Thanks in advance.

      1 Reply Last reply Reply Quote 0
      • IntruderExcluder
        IntruderExcluder last edited by

        You can set objectName to any item in QML and then use findChild method of QObject on C ++ side. But it looks like you shold reconsider app architecture, something like controller is would be useful to your app.

        1 Reply Last reply Reply Quote 1
        • First post
          Last post