mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-04 23:05:48 +02:00
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
This commit is contained in:
parent
ad3e02f5ef
commit
8b93dfe44e
1 changed files with 9 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue