diff options
author | Eike Ziller <eike.ziller@qt.io> | 2023-01-02 14:00:02 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2023-01-11 13:11:27 +0000 |
commit | 394caa1feeb3b11e989ca62e1ae58fe3bb0fb25b (patch) | |
tree | b8e48f5ce0b8214180bb06fe6ff4feb1d4a54883 | |
parent | 91b527427612d8a898746d13ec48a6fb15c1d335 (diff) |
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 <tasuku.suzuki@signal-slot.co.jp>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
-rw-r--r-- | src/plugins/coreplugin/manhattanstyle.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index 2164cd2238..766124be6a 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; |