mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-04 06:45:45 +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
|
delay: Qt.styleHints.mousePressAndHoldInterval
|
||||||
}
|
}
|
||||||
|
|
||||||
displayText: currentIndex !== -1 ?
|
displayText: {
|
||||||
currentSelectionText : (placeholderText !== "" ?
|
// If the index is -1 and the model is empty, display the placeholder text.
|
||||||
placeholderText :
|
// The placeholder text is either the placeholderText property or a default text.
|
||||||
JamiStrings.notAvailable)
|
// Otherwise, display the currentSelectionText property.
|
||||||
|
if (currentIndex < 0 && !count) {
|
||||||
|
return placeholderText !== "" ? placeholderText : JamiStrings.notAvailable
|
||||||
|
}
|
||||||
|
return currentSelectionText
|
||||||
|
}
|
||||||
|
|
||||||
delegate: ItemDelegate {
|
delegate: ItemDelegate {
|
||||||
width: root.width
|
width: root.width
|
||||||
|
|
Loading…
Add table
Reference in a new issue