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

overwrite on<Property>Changed:

    XMLWordPrintable

Details

    • User Story
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 6.1.2
    • None
    • Linux/X11

    Description

      i just wanted to make sure this is a feature and not a bug. (could not find it explicitly mentioned in the docs, but i guess it's implied that on<Property>Changed: is the same thing as using connect()?)

      the Bar.qml extends Foo.qml and would like to overwrite onAChanged:

      Foo.qml
      import QtQuick
      Item {
      	property int a
      	property int b
      	onAChanged: console.log("Foo.a")
      	onBChanged: bChange()
      	function bChange () {
      		console.log("Foo.b")
      	}
      }
      
      Bar.qml
      import QtQuick
      Foo {
      	onAChanged: console.log("Bar.a")
      	function bChange () {
      		console.log("Bar.b")
      	}
      	Component.onCompleted: {
      		a = 1
      		b = 2
      	}
      }
      

      but instead the onAChanged from Bar.qml is added:

      $ qml Bar.qml
      qml: Foo.a
      qml: Bar.a
      qml: Bar.b
      

      i was hoping for output like this:

      $ qml Bar.qml
      qml: Bar.a
      qml: Bar.b
      

      if that is a feature, i guess the easiest way to overwrite on<Property>Changed is the way done for b?

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            oskude Osku Schmidt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes