From 320071ac156db6e5c23c7daa647cbe9aae199f20 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 19 Mar 2014 18:29:35 -0300 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/modeldelegates.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'qt-ui') diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp index 85542f0f9..7ddfb9a16 100644 --- a/qt-ui/modeldelegates.cpp +++ b/qt-ui/modeldelegates.cpp @@ -162,7 +162,10 @@ bool ComboBoxDelegate::eventFilter(QObject *object, QEvent *event) QKeyEvent *ev = static_cast(event); if (ev->key() == Qt::Key_Up || ev->key() == Qt::Key_Down) { currCombo.ignoreSelection = true; - currCombo.comboEditor->showPopup(); + 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(); -- cgit v1.2.3-70-g09d2