Commit 5ef9aa22 authored by David Redondo's avatar David Redondo 🏎
Browse files

Do not reset the start page if the model changes

Combobox resets currentValue/Index when the model changes. Remember
the current value and reapply it.


(cherry picked from commit 5c3a4c6c)
parent 6f8d7f5c
......@@ -232,8 +232,13 @@ Dialog {
Connections {
target: sortModel
function onDataChanged() { startPageBox.model = startPageBox.createModel() }
function onRowsMoved() { startPageBox.model = startPageBox.createModel() }
function onDataChanged() { refreshModel() }
function onRowsMoved() { refreshModel() }
function refreshModel() {
const value = startPageBox.currentValue
startPageBox.model = startPageBox.createModel()
startPageBox.currentIndex = startPageBox.indexOfValue(value)
}
}
delegate: ItemDelegate {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment