Hi Michael
I agree with that, in fact that point was covered in the paragraph
starting "The downside is ...". Rather than lazy-loading pages, I
lazy-load page-content where requried (i.e creating the page takes a
noticable time). So the Page is static, but lazy-loads its child elements.
Grüsse
Chris
On 05.06.14 17:28, Michael Neufing wrote:
Hi Chris,
one problem I see with your solution is that the App could take long
time to launch, when there are a bunch of Pages that have to be
initialized at launch (depending on the structure of the Pages).
So I would prefer lazy loading Pages, which will be initialized when
it is needed.
Mit freundlichen Grüßen,
Michael Neufing
Christopher Lamb <christopher.l...@thurweb.ch> schrieb am 16:40
Donnerstag, 5.Juni 2014:
Hi Markus
In my app I chose to instantiate all my Pages in the same place. Each
of the pages has a declaration in a separate qml file (e.g.
MainPage.qml, AreaSelectionPage.qml).
With this architecture none of the declarations need to know about the
previous or next page. It is not their concern. Instead they emit
signals NextPage, BackPageWithInfo, and Cancelled. In the signal
handler in the page instantation I do the actual pushing and popping,
and because all pages are instantiated in the same scope, they are
all available to be pushed / popped to. (see code example below).
The downside is that all the pages are created on startup (regardless
of if they are ever visited). For lightweight pages this is not a
problem, but for some pages this might be a problem. For these I
dynamically create the page content when the page is visible.
Grüsse
Chris
ApplicationWindow {
id: appWindow
.......
initialPage: mainPage
MainPage {
id: mainPage
....
onNextPage: {
if (pageType =="SMS") {
console.log("smsType is: " + smsType)
if (smsType =="Default") pageStack.push(smsPage, {lati:
mainPage.getLati(), longi: mainPage.getLongi(),
alti: mainPage.getAlt
i(), area_id: area_id, template_id: template_id, msg_status: msg_status,
lastPage: "mainPage"})
}
else {
pageStack.push(areaSelectionPage)
}
}
}
AreaSelectionPage {
id: areaSelectionPage
....
onBackPageWithInfo: {
mainPage.areaSet = true;
mainPage.area_id = area_id;
pageStack.pop(mainPage);
}
onCancelled: pageStack.pop(mainPage);
}
SMSPage {
id: smsPage
....
onNextPage: {
pageStack.push(contactSelectionPage, {area_id: area_id,
template_id: template_id})
}
}
ContactSelectionPage {
id: contactSelectionPage
....
onBackPageWithInfo: {
console.log("About to pop smsPage; contactName: " + contactName +
", contactPhone: " + contactPhone);
smsPage.contactName = contactName;
smsPage.contactPhone = contactPhone;
smsPage.lastPage = "contactSelectionPage";
pageStack.pop(smsPage);
}
onCancelled: pageStack.pop(smsPage);
}
}
On 05.06.14 14:43, i...@flyingfischer.ch
<mailto:i...@flyingfischer.ch> wrote:
Thanks for your inputs!
Calling
PreviousPage.topic = "MyTopic";
pageStack.pop();
gives me a ReferenceError: PreviousPage is not defined.
PreviousPage.qml and property string topic do exist.
Thanks for your patience!
Markus
_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to
devel-unsubscr...@lists.sailfishos.org
<mailto:devel-unsubscr...@lists.sailfishos.org>
_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to
devel-unsubscr...@lists.sailfishos.org
<mailto:devel-unsubscr...@lists.sailfishos.org>
_______________________________________________
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