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. QQmlPropertyMap update from c++ not reflected in gui

QQmlPropertyMap update from c++ not reflected in gui

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

    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
    0

    • Login

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