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

QML properties of type variant always get their notify signal fired even when assigning whith the same value

    XMLWordPrintable

Details

    • b8cca95c0395369cdfb17c198aff085badcddd94

    Description

      Steps to reproduce:

      1. Launch the code below
      2. Click in the window once, note that both properties are being updated
      3. Click in the window again. Now onVariantPropChanged will be called again, even though the value hasn't changed. The int property, on the other hand, doesn't have this behavior

      import Qt 4.7
      
      Rectangle {
      	width: 200
      	height: 200
      
      	property variant variantProp: 0
      	property int intProp: 0
      
      	MouseArea {
      		anchors.fill: parent
      		onClicked: {
      			variantProp = 1;
      			intProp = 1;
      		}
      	}
      
      	onVariantPropChanged: {
      		console.log("Variant property changed")
      	}
      
      	onIntPropChanged: {
      		console.log("Int property changed")
      	}
      }
      

      Attachments

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

        Activity

          People

            aakenned Aaron Kennedy
            gregschlom Gregory Schlomoff
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes