From b6c2f8f8223e354447ddf8b6afa1bd6a162a77de Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 17 Oct 2015 13:40:47 +0200 Subject: [PATCH] + Allow to select item in completion box with mouse --- src/Gui/DlgExpressionInput.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Gui/DlgExpressionInput.cpp b/src/Gui/DlgExpressionInput.cpp index 2d8b5717f..dc70038c1 100644 --- a/src/Gui/DlgExpressionInput.cpp +++ b/src/Gui/DlgExpressionInput.cpp @@ -213,7 +213,9 @@ void DlgExpressionInput::mousePressEvent(QMouseEvent* ev) #endif //we need to reject the dialog when clicked on the background. As the background is transparent //this is the expected behaviour for the user - this->reject(); + bool on = ui->expression->completerActive(); + if (!on) + this->reject(); } void DlgExpressionInput::showEvent(QShowEvent* ev) @@ -240,8 +242,12 @@ bool DlgExpressionInput::eventFilter(QObject *obj, QEvent *ev) // on the size of the widget. Instead, it must be checked if the // cursor is on this or an underlying widget or outside. if (!underMouse()) { - qApp->removeEventFilter(this); - reject(); + bool on = ui->expression->completerActive(); + // Do this only if the completer is not shown + if (!on) { + qApp->removeEventFilter(this); + reject(); + } } }