mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 20:03:24 +00:00
Better handling of keyboard on the inline edition on equipment
The handling of keyboard is broken on Qt inside QComboBoxes. I'm trying ( and losing ) to make it less broken. This patch makes the code work reasonably well if you press Key_down or Key_up after having displayed the filter popup, which is different from the combobox popup for some reason. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
6ee3a6da52
commit
320071ac15
1 changed files with 4 additions and 1 deletions
|
@ -162,7 +162,10 @@ bool ComboBoxDelegate::eventFilter(QObject *object, QEvent *event)
|
|||
QKeyEvent *ev = static_cast<QKeyEvent *>(event);
|
||||
if (ev->key() == Qt::Key_Up || ev->key() == Qt::Key_Down) {
|
||||
currCombo.ignoreSelection = true;
|
||||
if (!currCombo.comboEditor->completer()->popup()->isVisible()){
|
||||
currCombo.comboEditor->showPopup();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (ev->key() == Qt::Key_Tab || ev->key() == Qt::Key_Enter || ev->key() == Qt::Key_Return) {
|
||||
currCombo.activeText = currCombo.comboEditor->currentText();
|
||||
|
|
Loading…
Add table
Reference in a new issue