Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-9603

Unable to set value of default dynamic properties in Designer's property editor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 4.7.0
    • 4.6.2
    • Tools: Designer
    • None
    • Any
    • 2ff6df5

    Description

      The default Designer property sheet (qdesigner_propertysheet.cpp) distinguishes between DynamicProperties and DefaultDynamicProperties. Both types of properties are visible in the property editor, but setting the value of DefaultDynamicProperties does not work correctly.

      The attached file creates a simple custom QPushButton that will set its text according to the value of a dynamic property. The file also creates a plugin to use the widget in Designer.

      Expected: Create a new form and add a DefaultDynamicPropertyTestWidget. Then change the value of the "aDynamicProperty" property in Designer's property editor. The button text should update.

      Observed: The button text does not update.

      The following change to qdesigner_propertysheet.cpp fixes this specific incorrect behavior:

      — qdesigner_propertysheet.cpp.orig
      +++ qdesigner_propertysheet.cpp
      @@ -1127,7 +1127,7 @@
      }
      }

      • if (isDynamicProperty(index)) {
        + if (isDynamicProperty(index) || isDefaultDynamicProperty(index)) {
        if (d->isResourceProperty(index))
        d->setResourceProperty(index, value);
        if (d->isStringProperty(index))

      However, I suspect that the issue is more complex than this fix: note that the initial value of the dynamic property is also incorrect.

      Attachments

        1. plugin.cpp
          7 kB
        2. plugin.pro
          0.1 kB
        3. QTBUG-9603.patch
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jkobus Jarek Kobus
            chrisgics Christopher Gaal
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes