Skip to content
Snippets Groups Projects
Commit 8b93dfe4 authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Sébastien Blin
Browse files

combobox: allow an invalid current model index

This will definitely be the case when filtering out the currently
selected item. I don't understand how this worked before SFPM.

GitLab: #890
Change-Id: Ib3e6945d2384707e128a52ab06457c157b2c7d0b
parent ad3e02f5
No related branches found
No related tags found
No related merge requests found
......@@ -37,10 +37,15 @@ ComboBox {
delay: Qt.styleHints.mousePressAndHoldInterval
}
displayText: currentIndex !== -1 ?
currentSelectionText : (placeholderText !== "" ?
placeholderText :
JamiStrings.notAvailable)
displayText: {
// If the index is -1 and the model is empty, display the placeholder text.
// The placeholder text is either the placeholderText property or a default text.
// Otherwise, display the currentSelectionText property.
if (currentIndex < 0 && !count) {
return placeholderText !== "" ? placeholderText : JamiStrings.notAvailable
}
return currentSelectionText
}
delegate: ItemDelegate {
width: root.width
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment