小技巧:运行qml最好方式,控制台调用qt bin目录下 qml.exe example.qml 。为了方法建议将QT bin路径加到系统变量path下面,以后想查看qml效果,直接任意控制台执行命令qml yourqml.qml
import QtQuick 2.12 import QtQuick.Controls 2.5 ApplicationWindow { visible: true width: 640 height: 480 title: qsTr("Tabs") SwipeView { id: swipeView anchors.fill: parent currentIndex: tabBar.currentIndex Page1Form { } Page2Form { } } footer: TabBar { id: tabBar currentIndex: swipeView.currentIndex TabButton { text: qsTr("Page 1") } TabButton { text: qsTr("Page 2") } } }
该代码实现:page1 page2点击互换
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
喜欢就支持一下吧