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

Ivailo Iliev ext-ivailo.iliev at nokia.com
Tue Jan 18 12:29:08 CET 2011


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


More information about the Qt-qml mailing list