4
如何防止頁面手動在SwipeView
中滑動?我想通過與按鈕交互來刷新當前索引。我怎樣才能做到這一點?這裏是我的QML代碼:如何防止頁面手動在SwipeView中滑動
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import QtQuick.Window 2.2
import QtQuick.Controls.Material 2.0
ApplicationWindow {
property int globalForJs: 10;
id: mainWindow
visible: true
width: 1024
height: 768
color: '#ffffff'
signal qmlSignal(string msg)
TopPanel {
id: topPanel1
}
SwipeView {
id: view
currentIndex: 0
anchors.fill: parent
Rectangle {
id: firstPage
color: "red"
}
Rectangle {
id: secondPage
color: "blue"
}
}
BottomPanel {
id: bottomPanel1
}
}