aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt
diff options
context:
space:
mode:
authorLars Christensen <larsch@belunktum.dk>2017-07-18 10:17:53 +0200
committerAnders Broman <a.broman58@gmail.com>2017-07-23 15:52:03 +0000
commit88fbc26175d8f32b01fac69828b7549a5ec53166 (patch)
tree9c4b1e4d4317cd53dc7e63144839c56b22c2eb00 /ui/qt
parentdaae7dbb1ff08b5f88953ddb77ef71454f3b1a3f (diff)
Inhibit unhandled Ctrl key presses being redirected to the display filter
Pressing the display filter shortcut Ctrl-/ inserts a '/' into the LineEdit. On Windows QKeyEvent::text() contains a printable character when Ctrl is held down and are being redirected in MainWindow::eventFilter(). This patch filters events that has the CtrlModifier. Change-Id: Iefed962b7a2cc944a39b09de9d84b4522a39ff13 Reviewed-on: https://code.wireshark.org/review/22697 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/qt')
-rw-r--r--ui/qt/main_window.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp
index 2678698a2c..cc7f0de3d7 100644
--- a/ui/qt/main_window.cpp
+++ b/ui/qt/main_window.cpp
@@ -965,7 +965,8 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event) {
// proto tree, and main welcome widgets.
if (event->type() == QEvent::KeyPress) {
QKeyEvent *kevt = static_cast<QKeyEvent *>(event);
- if (kevt->text().length() > 0 && kevt->text()[0].isPrint()) {
+ if (kevt->text().length() > 0 && kevt->text()[0].isPrint() &&
+ !(kevt->modifiers() & Qt::ControlModifier)) {
df_combo_box_->lineEdit()->insert(kevt->text());
df_combo_box_->lineEdit()->setFocus();
return true;