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

Regression: QML vector2d/3d/4d properties do not emit changed signal when value changes to all zeroes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.6.0
    • 5.6.0 Beta
    • None
    • Windows 7 64bit, qtdeclarative HEAD: e3942a2fa53113b34b3206f446dae3a638b8331f
    • a4b2fa94d28327b83c8a1ddce5741c29cb0a7e0c

    Description

      If you declare a vector2d/3d/4d property in QML, changing property value doesn't emit changed signal if the value changes from non-zero vector to all zeroes vector. For example:

          property vector2d v2: Qt.vector2d(-2, 0)
          property vector3d v3: Qt.vector3d(-2, 0, 0)
          property vector4d v4: Qt.vector4d(-2, 0, 0, 0)
      
          onV2Changed: console.log("onV2Changed:", v2)
          onV3Changed: console.log("onV3Changed:", v3)
          onV4Changed: console.log("onV4Changed:", v4)
      
          Button {
              anchors.centerIn: parent
              onClicked: {
                  console.log("Change v2.x...")
                  v2.x++
                  if (v2.x === 0)
                      console.log("onV2Changed missing???")
                  console.log("Change v3.x...")
                  v3.x++
                  if (v3.x === 0)
                      console.log("onV3Changed missing???")
                  console.log("Change v4.x...")
                  v4.x++
                  if (v4.x === 0)
                      console.log("onV4Changed missing???")
              }
          }
      

      Clicking the button a few times results in the following log, where you can see that the changed signals are missing when the vectors are zeroed:

      qml: Change v2.x...
      qml: onV2Changed: QVector2D(-1, 0)
      qml: Change v3.x...
      qml: onV3Changed: QVector3D(-1, 0, 0)
      qml: Change v4.x...
      qml: onV4Changed: QVector4D(-1, 0, 0, 0)
      qml: Change v2.x...
      qml: onV2Changed missing???
      qml: Change v3.x...
      qml: onV3Changed missing???
      qml: Change v4.x...
      qml: onV4Changed missing???
      qml: Change v2.x...
      qml: onV2Changed: QVector2D(1, 0)
      qml: Change v3.x...
      qml: onV3Changed: QVector3D(1, 0, 0)
      qml: Change v4.x...
      qml: onV4Changed: QVector4D(1, 0, 0, 0)
      

      See the attachment for full application.

      Looks like the changed signal was working properly in 5.5.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            fmeerkoetter Frank Meerkötter
            e0348803 Miikka Heikkinen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes