Uploaded image for project: 'Qt Design Studio'
  1. Qt Design Studio
  2. QDS-12242

DynamicPropertySection logic overwrites Qt.vector2d expressions

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • QDS 4.5
    • QDS 3.7, QDS 3.8, QDS 3.9, QDS 4.0, QDS 4.1, QDS 4.4, QDS 4.2, QDS 4.3.2
    • Property View
    • None
    • d72f55bbd (qds/dev)
    • QDS Berlin - 2024 Week 11/12

    Description

      When having a property like property vector2d test: Qt.vector2d(7 / Constants.width, 7 / Constants.height) and selecting a different item (e.g. dummy in the example below) then re-selecting the item with the test property the dynamic property logic will remove the expression and only leave the numbers in like property vector2d test: Qt.vector2d(7, 7).

      This is due to updateProxyValues() in DynamicPropertiesSection.qml:321 doesn't care about expressions. The actual expression
      Qt.vector2d(7 / Constants.width, 7 / Constants.height)
      is reduced to
      7 / Constants.width, 7 / Constants.height
      and then split on ",". This will result in an array
      [7 / Constants.width, 7 / Constants.height]
      Each of the elements will be parsed with parseFloat() which removes all the unknown strings and results in [7, 7].

      Rectangle {
          id: rectangle
          width: Constants.width
          height: Constants.height
      
          color: Constants.backgroundColor
      
          // Qt.vector2d(1 / Constants.width, 1 / Constants.height)
          // Qt.vector2d(7 / Constants.width, 7 / Constants.height)
          property vector2d test: Qt.vector2d(7, 7)
      
          property real textX: 1 / Constants.width
      
          Item {
              id: dummy
          }
      }
      

      Attachments

        For Gerrit Dashboard: QDS-12242
        # Subject Branch Project Status CR V

        Activity

          People

            thohartm Thomas Hartmann
            henning Henning Gründl
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes