Hi Goncalo.

pageStatus will change to activated both the first time your page becomes the 
current page of the PageStack, and when you change back to it from another 
page.  I guess that your error occurs when it tries to call pushAttached() a 
second time, as the original page is re-activated.

Probably the easiest way to avoid this is to hold the attached page in a 
property, similar to:

    property Page attached
    onStatusChanged: {
        if (!attached && status == PageStatus.Active) {
            attached = pageStack.pushAttached("SecondPage.qml")
        }
    }

Thanks,
Matt

________________________________________
From: devel-boun...@lists.sailfishos.org [devel-boun...@lists.sailfishos.org] 
on behalf of Goncalo Carvalho [glsl...@gmail.com]
Sent: Saturday, August 23, 2014 6:06 PM
To: Sailfish OS Developers
Subject: Re: [SailfishDevel] Warning when running under debugger

Hi,

Yes. But that's just Page. All children of Page in SecondPage.qml have
anchors referencing parent. And it only happens when flicking back to
the initial Page (should have mentioned that).

So I'm assuming there's some code missing to do this back and forwarding.

Actually it doesn't matter if the above code is added or not. The
original tutorial app does the same when flicking back to the initial
page. Wonder if is Silica thing then.

Goncalo

On 23 August 2014 08:53, Andrey Kozhevnikov <coderusin...@gmail.com> wrote:
> error inside SecondPage.qml on line 35
>
> 23.08.2014 13:52, Goncalo Carvalho пишет:
>>
>> Hi,
>>
>> Long time lurker and a QML newbie. I've been playing with the tutorial
>> and adding this code to FirstPage.qml
>>
>>     onStatusChanged: {
>>
>>          if (status === PageStatus.Active && pageStack.depth === 1) {
>>
>>              pageStack.pushAttached(Qt.resolvedUrl("SecondPage.qml"))
>>
>>          }
>>
>>      }
>>
>> leads to the below warning when running under the debugger
>>
>> [W] unknown:35 -
>> file:///usr/share/myfirstapp/qml/pages/SecondPage.qml:35:1: QML Page:
>> Cannot anchor to an item that isn't a parent or sibling.
>>
>> It doesn't appear to be an issue when not running under the debugger.
>> This is all from Qt Creator.
>>
>> I understand why QML would complain with the above in general, but
>> what I don't get is why isn't always a warning or if there's a better
>> way of mimicking the above behaviour?
>>
>> Many thanks,
>>
>> Goncalo
>>
>> PS: Great phone btw. Replaced my N95! Only phone able to do that...
>> _______________________________________________
>> SailfishOS.org Devel mailing list
>> To unsubscribe, please send a mail to
>> devel-unsubscr...@lists.sailfishos.org
>
>
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org



--
http://www.cryogenicgraphics.com
http://www.flickr.com/photos/hdrflow
_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org
_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Reply via email to