PageStack vs pageStackWindow element
-
- Which one should I use and when/why?
- Does pageStackWindow contain pageStack? I mean does pageStackWindow instantiate pageStack element? Do I have to instantiate it myself? I guess I don't have to.
- Can I use both in Symbian and in MeeGo?
More on pageStack
http://doc.qt.nokia.com/qt-components-symbian/qml-pagestack.htmlMore on pageStackWindow
http://doc.qt.nokia.com/qtquick-components-symbian-1.1/qml-pagestackwindow.html -
"1. Which one should I use and when/why?"
The docs has it all
"Applications can be constructed using the PageStackWindow that brings the page navigation, statusbar, toolbar, and platform's common look and feel.""2. Does pageStackWindow contain pageStack? I mean does pageStackWindow instantiate pageStack element? Do I have to instantiate it myself? I guess I don’t have to"
PageStack is a primitive way to manage stack of application pages. I suggest using PageStackWindow as it takes the extra effort of instantiating required application window components. You can access pagestack via pageStack property.
"3. Can I use both in Symbian and in MeeGo?"
Yes.Thanks,
Srikanth -
Hi Srikanth,
Thanks for your answer. I wasn't sure which one of the two should I use. If pageStackWindow is newer I will use it instead.
I got confused because most of the documentation uses pageStack in combination with window instead.
The thing that is also bothering me is than when i use pageStackWindow and I change my orientation I get the error message:
"ReferenceError: Can’t find variable: statusBar"
When I use pageStack in combination with window I don't see this message.
I have described this here:
http://developer.qt.nokia.com/forums/viewthread/13189/ -
Using PageStackWindow will do the combination of window and pageStack. PageStackWindow is introduced newly in QtQuick 1.1 hence most documents prior to it refer to 1.0 implementation.
By the way, how are you accessing statusBar? It is not provided from PageStackWindow or Window.
Thanks,
Srikanth -
You can easly recreate this error. Just create new project using Qt Quick components. It will create Hello World app. When you run it and rotate the screen you will get this error in console view.
“ReferenceError: Can’t find variable: statusBar”I haven't added any code. My main.qml look like this
@import QtQuick 1.1
import com.nokia.symbian 1.1PageStackWindow{
id:window
initalPage: MainPage {tools: toolBarLayout}
showStatusBar:true
showToolBar:trueToolBarLayout{ .... }
}@
If I comment out showStatusBar:true I have noticed I don't get this message anymore. Am I doing something wrong here?
I am using Qt SDK 1.1.4.
Qt Creator 2.4.0
Based on Qt 4.7.4 (32 bit)
Built on Dec 16 2011 at 03:25:42
I have Windows 7 OS