HSplitView with state saving and default props
This commit is contained in:
17
src/qml/Base/HSwipeView.qml
Normal file
17
src/qml/Base/HSwipeView.qml
Normal file
@@ -0,0 +1,17 @@
|
||||
import QtQuick.Controls 2.12
|
||||
|
||||
SwipeView {
|
||||
currentIndex: window.getState(this, "currentIndex", defaultIndex)
|
||||
onCurrentIndexChanged: window.saveState(this)
|
||||
|
||||
|
||||
property string saveName: ""
|
||||
property var saveId: "ALL"
|
||||
property var saveProperties: ["currentIndex"]
|
||||
|
||||
property int defaultIndex: 0
|
||||
property bool changed: currentIndex !== defaultIndex
|
||||
|
||||
|
||||
function reset() { setCurrentIndex(defaultIndex) }
|
||||
}
|
Reference in New Issue
Block a user