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 <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Tasuku Suzuki
2022-08-26 21:01:34 +09:00
parent a7956df3ca
commit f160b50bda

View File

@@ -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;
}