[Interest] React to signal only when at top of StackView

J-P Nurmi jpnurmi at qt.io
Sat May 7 10:20:17 CEST 2016


> On 06 May 2016, at 23:27, Elvis Stansvik <elvstone at gmail.com> wrote:
> 
> 2016-05-06 22:41 GMT+02:00 J-P Nurmi <jpnurmi at qt.io>:
>> 
>> 
>> The Stack.status property must be attached to an item that is in a StackView. In the snippet above, it is attached to the Connections element. You can give the Rectangle element an id to be able to attach the property to it instead.
>> 
>>            initialItem: Rectangle {
>>               id: rect // <==
>>               anchors.fill: parent
>>               color: "green"
>>               Connections {
>>                   target: rect.Stack.status === rect.Stack.Active ? button : null // <==
> 
> BTW, out of curiosity, do you know why the above works, but not:
> 
>                   target: parent.Stack.status === parent.Stack.Active
> ? button : null // <==
> 
> ?
> 
> Elvis

Hi, it’s because ‘parent’ is a property of Item, but Connections is not an Item.

--
J-P Nurmi



More information about the Interest mailing list