aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-03-19 18:29:35 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-03-20 09:49:33 -0700
commit320071ac156db6e5c23c7daa647cbe9aae199f20 (patch)
tree7071e9ed2f3f8d84a1ee307f3f72e473de7e756f
parent6ee3a6da527a0dab034c975f0a8a40d08a1f048b (diff)
downloadsubsurface-320071ac156db6e5c23c7daa647cbe9aae199f20.tar.gz
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>
-rw-r--r--qt-ui/modeldelegates.cpp5
1 files changed, 4 insertions, 1 deletions
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<QKeyEvent *>(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();