mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
auto refill selected value of filter combobox on focus out
This commit is contained in:
parent
4319136dd8
commit
6e16479d22
1 changed files with 9 additions and 0 deletions
|
|
@ -57,6 +57,15 @@ class FilterComboBox(QtWidgets.QComboBox):
|
|||
super(FilterComboBox, self).focusInEvent(event)
|
||||
self.lineEdit().selectAll()
|
||||
|
||||
def focusOutEvent(self, event):
|
||||
idx = self.currentIndex()
|
||||
if idx > -1:
|
||||
index = self.model().index(idx, 0)
|
||||
text = index.data(QtCore.Qt.DisplayRole)
|
||||
if text != self.lineEdit().text():
|
||||
self.lineEdit().setText(text)
|
||||
super(FilterComboBox, self).focusOutEvent(event)
|
||||
|
||||
def on_completer_activated(self, text):
|
||||
if text:
|
||||
index = self.findText(text)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue