[Qt-qml] how I can access signals signals of the aliased properties

Mark Tucker mark.tucker at airborne.aero
Tue Jan 18 13:31:05 CET 2011


Hello,

Perhaps the Connections Element is what you require here?

http://doc.qt.nokia.com/4.7-snapshot/qml-connections.html

Mark T

-----Original Message-----
From: qt-qml-bounces+mark.tucker=airborne.aero at qt.nokia.com
[mailto:qt-qml-bounces+mark.tucker=airborne.aero at qt.nokia.com] On Behalf
Of Ivailo Iliev
Sent: 18 January 2011 11:29
To: qt-qml at qt.nokia.com
Subject: [Qt-qml] how I can access signals signals of the aliased
properties

Hi all,

I'm having case like this

ItemA {
     property variant myProperty
}

ItemB {
     property alias myAlias: test.myProperty
     ItemA{ id: test }
}

And it seems that onMyAliasChanged is never fired - I need to listen to 
onMyPropertyChanged directly. But in my case I want to "hide" ItemA and 
just expose this property.

Am I doing something wrong or there is another way to do it?

The only thing I can think of for now is:

ItemB {
     property alias myAlias: test.myProperty
     signal MyAliasHasChanged()
     ItemA
         id: test
         onMyPropertyChanged: {
             MyAliasHasChanged()
         }
     }
}

but it seems a little bit ugly and I need to use connect not only one 
alias - and it's a lot of "bogus" coding.

Thanks in advance for the help,
Ivo
_______________________________________________
Qt-qml mailing list
Qt-qml at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-qml


More information about the Qt-qml mailing list