Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QtPropertyBrowser not handling Q_PROPERTY Notify event
Forum Updated to NodeBB v4.3 + New Features

QtPropertyBrowser not handling Q_PROPERTY Notify event

Scheduled Pinned Locked Moved General and Desktop
10 Posts 2 Posters 2.1k 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.
  • L Offline
    L Offline
    LeifZars
    wrote on last edited by
    #1

    Starting with the example object_controller from qt-solutions I implemented a few objects with Q_PROPERTY attributes.
    @
    Q_PROPERTY(int ModuleId READ moduleId WRITE setModuleId NOTIFY moduleIdChanged)
    @
    Everything works except when I change the field programticly the PropertyBrowser doesn't update. The moduleIdChanged signal is emitted but nothing is attached. What could I be doing wrong.

    Leif

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on last edited by
      #2

      Welcome to DevNet!

      Have you connected moduleIdChanged signal to any slots in the PropertyBrowser?

      1 Reply Last reply
      0
      • L Offline
        L Offline
        LeifZars
        wrote on last edited by
        #3

        I am not sure I understand. I don't believe the QObjects that I am visualizing via the Property Browser contain such a signal. Maybe I am misunderstanding.

        FYI this is the example I used to module my code around: https://qt.gitorious.org/qt-solutions/qt-solutions/source/fd22bee22274975c56f1c10d87ee9fd2c0818f83:qtpropertybrowser/examples/object_controller

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andreyc
          wrote on last edited by
          #4

          [quote author="LeifZars" date="1407527414"]I implemented a few objects with Q_PROPERTY attributes.
          @
          Q_PROPERTY(int ModuleId READ moduleId WRITE setModuleId NOTIFY moduleIdChanged)
          @
          Everything works except when I change the field programticly the PropertyBrowser doesn't update. The moduleIdChanged signal is emitted but nothing is attached. What could I be doing wrong.
          [/quote]

          You have implemented a signal that notifies about the changes in the objects.
          To get these notifications in the property browser you need to connect the browser's slot to this signal.

          1 Reply Last reply
          0
          • L Offline
            L Offline
            LeifZars
            wrote on last edited by
            #5

            It was my imprecision that the PropertyBrowser automatically did that, but maybe not.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andreyc
              wrote on last edited by
              #6

              I don't think it is a generic property browser for any QObject based classes.
              Do you use QtIntPropertyManager::addProperty() to add ModuleId to the properties hierarchy?
              Have you implemented your property browser based on QtAbstractPropertyBrowser?

              1 Reply Last reply
              0
              • A Offline
                A Offline
                andreyc
                wrote on last edited by
                #7

                "Here":http://doc.qt.digia.com/qq/qq18-propertybrowser.html is an article that explains the property browser framework.

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  LeifZars
                  wrote on last edited by
                  #8

                  Sorry for the long delay.

                  Yes I do use addProperty .

                  I am using QtTreePropertyBrowser, it is based on the QtAbstractPropertyBrowser.

                  The method I use, addClassProperties, is taken from object_controller qtPropertyBrowser example. It doesn't appear to handle change events, so I will have to add that.

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    LeifZars
                    wrote on last edited by
                    #9

                    I am also using QtVariantPropertyManager, it seems that I will have to modify this. I don't see how else I could connect the properties change signal to the managed widget.

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      LeifZars
                      wrote on last edited by
                      #10

                      I am having trouble determining how I should implement this. Any ideas.

                      Also per
                      http://www.wiki.crossplatform.ru/index.php/The_Property_Browser_Framework If you search for the word sync on that page, it says that the is internally handled.

                      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