when i use PageStack between pages then memory increase. From Main.qml, i call page MainPage.qml . after that i call page PageDetail.qml . Memory increase but i go back page MainPage.qml then memory does not decrease
this is my code
main.qml
import com.nokia.symbian 1.0
Window {
id: window
StatusBar {
id: statusBar
anchors.top: window.top
}
PageStack {
id: pageStack
anchors { left: parent.left; right: parent.right; top: statusBar.bottom; bottom: toolBar.top }
}
ToolBar {
id: toolBar
anchors.bottom: window.bottom
tools: ToolBarLayout {
id: toolBarLayout
ToolButton {
flat: true
iconSource: "toolbar-back"
onClicked: pageStack.depth <= 1 ? Qt.quit() : pageStack.pop()
}
}
}
Component.onCompleted: {
pageStack.push(Qt.resolvedUrl("MainPage.qml"))
}
}
import com.nokia.symbian 1.0
Window {
id: window
StatusBar {
id: statusBar
anchors.top: window.top
}
PageStack {
id: pageStack
anchors { left: parent.left; right: parent.right; top: statusBar.bottom; bottom: toolBar.top }
}
ToolBar {
id: toolBar
anchors.bottom: window.bottom
tools: ToolBarLayout {
id: toolBarLayout
ToolButton {
flat: true
iconSource: "toolbar-back"
onClicked: pageStack.depth <= 1 ? Qt.quit() : pageStack.pop()
}
}
}
Component.onCompleted: {
pageStack.push(Qt.resolvedUrl("MainPage.qml"))
}
}
To copy to clipboard, switch view to plain text mode
MainPage.qml
import QtQuick 1.0
import com.nokia.symbian 1.0
Page {
id: mainPage
Text {
id: text1
anchors.centerIn: parent
text: qsTr("Hello world!")
color: platformStyle.colorNormalLight
font.pixelSize: 20
}
Button{
width: 150
text :"page 2"
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: text1.bottom
anchors.topMargin: 10
onClicked: {
pageStack.push(Qt.resolvedUrl("PageDetail.qml"))
}
}
}
import QtQuick 1.0
import com.nokia.symbian 1.0
Page {
id: mainPage
Text {
id: text1
anchors.centerIn: parent
text: qsTr("Hello world!")
color: platformStyle.colorNormalLight
font.pixelSize: 20
}
Button{
width: 150
text :"page 2"
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: text1.bottom
anchors.topMargin: 10
onClicked: {
pageStack.push(Qt.resolvedUrl("PageDetail.qml"))
}
}
}
To copy to clipboard, switch view to plain text mode
PageDetail.qml
i
mport QtQuick 1.0
import com.nokia.symbian 1.0
Page {
Button {
id: button1
x: 142
y: 437
text: "Tro ve"
onClicked: pageStack.pop()
}
}
mport QtQuick 1.0
import com.nokia.symbian 1.0
Page {
Button {
id: button1
x: 142
y: 437
text: "Tro ve"
onClicked: pageStack.pop()
}
}
To copy to clipboard, switch view to plain text mode
how to decrease memory when go back page ManiPage.qml ?
thanks.
Bookmarks