onclicked button open "new" form
-
Just quick other question, it's not possible to do in the main.qml the action button task and make the form I want for each page?
example:
main.qmlApplicationWindow { visible: true width: 640 height: 480 button { id: button1 anchors.fill: parent MouseArea { id: mouseArea anchors.fill: parent onClicked: page2.qml() } button { id: button2 anchors.fill: parent MouseArea { id: mouseArea anchors.fill: parent onClicked: page3.qml() }
it's not real code that just to illustrate what I have in my mean ;-)
@filipdns
It is, but you want it to be part of the SwipeView
Image the structure being a tree, so we must add them to the SwipeView structure for them to be "in" itSwipeView { id: swipeView anchors.fill: parent currentIndex: tabBar.currentIndex Page1 { Button { onClicked:{swipeView.currentIndex = swipeView.currentIndex+1} text: "Button" } } Page { Label { text: qsTr("Second page") anchors.centerIn: parent } } }
Else they be under ApplicationWindow and we can not change page. (also swipeview might cover them)
-
@filipdns
It is, but you want it to be part of the SwipeView
Image the structure being a tree, so we must add them to the SwipeView structure for them to be "in" itSwipeView { id: swipeView anchors.fill: parent currentIndex: tabBar.currentIndex Page1 { Button { onClicked:{swipeView.currentIndex = swipeView.currentIndex+1} text: "Button" } } Page { Label { text: qsTr("Second page") anchors.centerIn: parent } } }
Else they be under ApplicationWindow and we can not change page. (also swipeview might cover them)
-
@filipdns
Ignore the swipe effect for now.
Its to handle the actual page switching. (not to get the animation)
Else you would have to hide or show all elements depending on what
page you are currently viewing.Alternativ you can use
http://doc.qt.io/qt-5/qml-qtquick-controls-stackview.html
which have no animation effect as far as i know. -
hello, it's just the way to do what the topic ask ;-)
import QtQuick 2.2 import QtQuick.Controls 1.2 import QtQuick.Controls.Styles 1.1 Item { width: parent.width height: parent.height Column { spacing: 5 Button { anchors.margins: 20 text: "24" onClicked: stackView.push (Qt.resolvedUrl("SliderPage.qml")) } }