Qt Forum

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

    Update: Forum Guidelines & Code of Conduct

    Unsolved QQuickView - singleton Component question

    QML and Qt Quick
    1
    1
    240
    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.
    • cmessineo
      cmessineo last edited by

      Here is my simple Singleton component:

      pragma Singleton
      import QtQuick 2.0
      
      Item {
          id: va
          objectName: "va"
      
          property font my_font: Qt.font({
              family: "Arial",
                                         });
      
          property real version: 1;
      }
      

      How can I update the version property through C++ code?

      I tried this, but to no avail:

      QQuickItem obj = quickview->rootObject()->findChild<QQuickItem>("va");
      ...
      obj->setProperty("version", "2");

      quickview loads a qml file that includes the singleton component.

      Thanks

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