[SailfishDevel] Pass data from MainPage into CoverPage

Michael Faro-Tusino mfaro-tusino at live.com
Mon Jun 3 02:58:27 UTC 2013


Hi guys,

This is a very beginner question I know, but still having some troubles.

I am trying to create a Cover Page for my app, that uses information from the Main Page (note: this is not main.qml but MainPage.qml).

I've attempted to set up property aliases like so:

//main.qml
import QtQuick 1.1
import Sailfish.Silica 1.0
import "pages"
import "cover"

ApplicationWindow
{
       id: appWindow
    property string total
    property string perPerson
    initialPage: MainPage { }
    cover: CoverPage{ }
}

//MainPage.qml
import QtQuick 1.1
import Sailfish.Silica 1.0

Page{
    id: mainPage
    property alias total : appWindow.total 
    property alias perPerson : appWindow.perPerson
}

//coverPage.qml
import QtQuick 1.1
import Sailfish.Silica 1.0



Page {
    id: coverPage
    property alias total: appWindow.total
    property alias perPerson: appWindow.perPerson
}

I get errors saying that appWindow cannot be found, due to errors caused by using initialPage: MainPage{} and cover: CoverPage{} in my main.qml.

I don't see why setting Initial and cover the way I did results in errors, (so that is something I'd like explained if possible) and secondly, could someone help me pass the information from MainPage to CoverPage (it updates when a function is executed on MainPage if that makes a difference).

Thanks in advance,
Michael


-------------------------Michael Faro-Tusino
Twitter: @MFaroTusino
Website: My Nokia Blog

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sailfishos.org/pipermail/devel/attachments/20130603/13fe0491/attachment.html>


More information about the Devel mailing list