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 how to notify QML of updates
Forum Updated to NodeBB v4.3 + New Features

QQmlPropertyMap how to notify QML of updates

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
18 Posts 4 Posters 1.5k Views 1 Watching
  • 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.
  • JoeCFDJ JoeCFD

    @SPlatten Do not calling insert() mean binding or clear() mean release binding? It makes sense that the value is not changed.

    SPlattenS Offline
    SPlattenS Offline
    SPlatten
    wrote on last edited by
    #9

    @JoeCFD , this is a project that already exists, I am adding functionality to it.

    JoeCFDJ 1 Reply Last reply
    0
    • SPlattenS SPlatten

      @JoeCFD , this is a project that already exists, I am adding functionality to it.

      JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by
      #10

      @SPlatten Read the example:
      https://doc.qt.io/qt-5.15/qqmlpropertymap.html

      QQmlPropertyMap ownerData;
      ownerData.insert("name", QVariant(QString("John Smith")));  ==> will not trigger valueChanged, sort of like initialization
      ownerData.insert("phone", QVariant(QString("555-5555")));
      

      write a small program to test it.

      SPlattenS 1 Reply Last reply
      0
      • JoeCFDJ JoeCFD

        @SPlatten Read the example:
        https://doc.qt.io/qt-5.15/qqmlpropertymap.html

        QQmlPropertyMap ownerData;
        ownerData.insert("name", QVariant(QString("John Smith")));  ==> will not trigger valueChanged, sort of like initialization
        ownerData.insert("phone", QVariant(QString("555-5555")));
        

        write a small program to test it.

        SPlattenS Offline
        SPlattenS Offline
        SPlatten
        wrote on last edited by SPlatten
        #11

        @JoeCFD , is it only the initial insert of an item that does not trigger the valueChanged signal ?

        I will try this out tomorrow, thank you.

        JoeCFDJ 1 Reply Last reply
        0
        • SPlattenS SPlatten

          @JoeCFD , is it only the initial insert of an item that does not trigger the valueChanged signal ?

          I will try this out tomorrow, thank you.

          JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by
          #12

          @SPlatten the doc says clear() does not as well.

          SPlattenS 1 Reply Last reply
          0
          • JoeCFDJ JoeCFD

            @SPlatten the doc says clear() does not as well.

            SPlattenS Offline
            SPlattenS Offline
            SPlatten
            wrote on last edited by SPlatten
            #13
            This post is deleted!
            JoeCFDJ B 2 Replies Last reply
            0
            • SPlattenS SPlatten

              This post is deleted!

              JoeCFDJ Offline
              JoeCFDJ Offline
              JoeCFD
              wrote on last edited by
              #14

              @SPlatten In QML I guess you use id for connections.

              1 Reply Last reply
              0
              • SPlattenS SPlatten

                This post is deleted!

                B Offline
                B Offline
                Bob64
                wrote on last edited by
                #15

                @SPlatten I haven't followed this whole thread so apologies if I have missed something, but but regarding your most recent question, could you set your QQmlPropertyMap as a context property in your C++ back end? You would then be able in QML to use the name that you registered the context property as.

                1 Reply Last reply
                1
                • D Offline
                  D Offline
                  Drooke
                  wrote on last edited by
                  #16

                  Might be able to try:
                  Item{
                  Property var myData: backendQqmlPropertyMap.name
                  OnMyDataChanged{
                  // Doathing
                  }
                  }

                  Sorry for formatting, on a phone currently!

                  1 Reply Last reply
                  1
                  • SPlattenS Offline
                    SPlattenS Offline
                    SPlatten
                    wrote on last edited by
                    #17
                    This post is deleted!
                    SPlattenS 1 Reply Last reply
                    0
                    • SPlattenS SPlatten

                      This post is deleted!

                      SPlattenS Offline
                      SPlattenS Offline
                      SPlatten
                      wrote on last edited by SPlatten
                      #18
                      This post is deleted!
                      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