From 394caa1feeb3b11e989ca62e1ae58fe3bb0fb25b Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 2 Jan 2023 14:00:02 +0100 Subject: [PATCH] Allow combo box scroll wheel when pressing Ctrl Wheel scrolling was disabled for combo boxes in Qt Creator 9, because it created more issues than it solved. Instead of completely disabling it, allow wheel scrolling when simultaneously holding Ctrl. Fixes: QTCREATORBUG-28578 Change-Id: I08bccf039b60035bf425fac95b6af6fad349f43a Reviewed-by: Tasuku Suzuki Reviewed-by: Alessandro Portale --- src/plugins/coreplugin/manhattanstyle.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index 2164cd22380..766124be6a0 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -391,8 +391,10 @@ int ManhattanStyle::styleHint(StyleHint hint, const QStyleOption *option, const ret = 0; break; case QStyle::SH_ComboBox_AllowWheelScrolling: - // Turn this off completely to prevent accidental current index change on a scroll view - ret = false; + // Turn this on only when simultaneously pressing Ctrl, to prevent accidental current + // index change, e.g. on a scroll view + ret = QGuiApplication::keyboardModifiers() + == (HostOsInfo::isMacHost() ? Qt::MetaModifier : Qt::ControlModifier); break; default: break;