From 88fbc26175d8f32b01fac69828b7549a5ec53166 Mon Sep 17 00:00:00 2001 From: Lars Christensen Date: Tue, 18 Jul 2017 10:17:53 +0200 Subject: 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 Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- ui/qt/main_window.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ui/qt') 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(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; -- cgit v1.2.3