Hi I am trying to create a path view. Please find below the attached sample code snippet. When ever i try to do an incrementCurrentIndex(), I get a empty field at the begining of the pathview and that empty entry is filled with next element when i do decrementCurrentIndex(). How can i make my pathview behave the same both during incrementCurrentIndex() and decrementCurrentIndex() ?
import QtQuick 2.0
Item {
width: 180
height: 250
PathView {
id: list
focus: true
preferredHighlightBegin: 2/5
preferredHighlightEnd: 3/5
highlightRangeMode: PathView.ApplyRange
Keys.onUpPressed: decrementCurrentIndex()
Keys.onDownPressed: incrementCurrentIndex()
model: 5
delegate: Rectangle {
id: wrapper
border.width: 1
border.color: "green"
width: 180
height: 40
color: "steelblue"
Text {anchors.centerIn: parent; text: index; font.bold: wrapper.PathView.isCurrentItem?true:false}
}
path: Path {
id: path
startX: 90; startY: 20
PathLine { x: 90; y: 40*(5)}
}
}
}
import QtQuick 2.0
Item {
width: 180
height: 250
PathView {
id: list
focus: true
preferredHighlightBegin: 2/5
preferredHighlightEnd: 3/5
highlightRangeMode: PathView.ApplyRange
Keys.onUpPressed: decrementCurrentIndex()
Keys.onDownPressed: incrementCurrentIndex()
model: 5
delegate: Rectangle {
id: wrapper
border.width: 1
border.color: "green"
width: 180
height: 40
color: "steelblue"
Text {anchors.centerIn: parent; text: index; font.bold: wrapper.PathView.isCurrentItem?true:false}
}
path: Path {
id: path
startX: 90; startY: 20
PathLine { x: 90; y: 40*(5)}
}
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks