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. How to get the default value of a property

How to get the default value of a property

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 1.1k 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.
  • Entw PmoE Offline
    Entw PmoE Offline
    Entw Pmo
    wrote on last edited by
    #1

    Hi,

    I'm reading all properties of different widgets with the QMetaObject and QMetaProperty classes.
    Now I'm trying to find out wich property has been changed.
    But with the QMetaProperty::read() I only can get the current value of a property.

    Does any one know, how I can get the default value of a property or which property has changed?

    Thanx. :-)

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by VRonin
      #2

      http://doc.qt.io/qt-5/qmetaproperty.html#hasNotifySignal
      http://doc.qt.io/qt-5/qmetaproperty.html#notifySignal
      http://stackoverflow.com/a/12352770

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      1
      • Entw PmoE Offline
        Entw PmoE Offline
        Entw Pmo
        wrote on last edited by
        #3

        Thank you for your fast answer.
        Sorry, that doesn't work in my case, because I can't connect every property to a changed slot.

        What I want to do is, to get for any arbitrary property the default value.

        Thanx.

        VRoninV 1 Reply Last reply
        0
        • Entw PmoE Entw Pmo

          Thank you for your fast answer.
          Sorry, that doesn't work in my case, because I can't connect every property to a changed slot.

          What I want to do is, to get for any arbitrary property the default value.

          Thanx.

          VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by
          #4

          There is no concept of "default value".
          The whole Qt Meta-Object system (and, most importantly, QtQuick) rely on the NOTIFY signal in the property to detect when a property changed

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          1 Reply Last reply
          0
          • Entw PmoE Offline
            Entw PmoE Offline
            Entw Pmo
            wrote on last edited by
            #5

            OK, 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