Qt Forum

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

    Unsolved QQmlPropertyMap update from c++ not reflected in gui

    QML and Qt Quick
    1
    1
    70
    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.
    • U
      UKLU last edited by

      Dear Specialists,

      I have:

      defined static var:
      QQmlPropertyMap MasterParameter::theMasterParameterMap;

      set up and registered:
      theMasterParameterMap["AutoLogoffText"] = "";
      theEngine->rootContext()->setContextProperty(APPLICATION_NAME,&theMasterParameterMap);

      used:
      Label
      {
      text: KompliKat.AutoLogoffText
      color: KompliKat.FontHighLightColor
      anchors.centerIn: parent
      }

      And:
      This works perfectly!

      But:
      But when I update the value from a QTimer callback in c++:

      MasterParameter::theMasterParameterMap["AutoLogoffText"] = <<< QString from SQL query >>>;

      the qml front end does not display the new value.

      The documentation states, that:
      The binding is dynamic - whenever a key's value is updated, anything bound to that key will be updated as well.

      Am I missing something here? How can I get this to work?
      I cannot for the life of me figure out what the Problem is here :-(
      Any hints are greatly appreciated! Thank you for your time!

      Marc

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