2016-05-07 10:20 GMT+02:00 J-P Nurmi <[email protected]>:
>> On 06 May 2016, at 23:27, Elvis Stansvik <[email protected]> wrote:
>>
>> 2016-05-06 22:41 GMT+02:00 J-P Nurmi <[email protected]>:
>>>
>>>
>>> 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.

Ah yes, of course. Thanks.

I think I was confused because Qt Creator made parent italic when I
wrote it like that, as if it was defined, and I got no errors when
running. I couldn't get that behavior in a simple testcase though, so
not sure why it thought parent was defined there (following the symbol
with F2 did nothing).

Elvis

>
> --
> J-P Nurmi
>
> _______________________________________________
> Interest mailing list
> [email protected]
> http://lists.qt-project.org/mailman/listinfo/interest
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to