From f160b50bdafe56a53bea52a9323746762ffa3367 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Fri, 26 Aug 2022 21:01:34 +0900 Subject: [PATCH] QComboBox: not accept wheel events for changing values It is dangerous for combo boxes within scroll views especially. Fixes: QTCREATORBUG-28103 Change-Id: Ibed498658ce9d6f5b90f6d7e8ec7c4f2bbd015aa Reviewed-by: Eike Ziller Reviewed-by: Alessandro Portale --- src/plugins/coreplugin/manhattanstyle.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index 9be20a25373..af050a3e850 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -390,6 +390,10 @@ int ManhattanStyle::styleHint(StyleHint hint, const QStyleOption *option, const if (widget && widget->inherits("QTreeView")) ret = 0; break; + case QStyle::SH_ComboBox_AllowWheelScrolling: + // Turn this off completely to prevent accidental current index change on a scroll view + ret = false; + break; default: break; }