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. QQuickView - singleton Component question
QtWS25 Last Chance

QQuickView - singleton Component question

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

    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
    0

    • Login

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