我创建了一个qt快速控件的新项目2.默认情况下有SwipeView
。
现在我想使用onIndexChanged
的{{1}}事件,但我收到了错误
SwipeView
错误
qrc:/main.qml:25无法分配给不存在的属性" onIndexChanged"
答案 0 :(得分:2)
SwipeView
没有index
这样的属性。你可能意味着currentIndex
。
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
SwipeView {
// ...
onCurrentIndexChanged: {
console.log(currentIndex)
}
}