forked from qt-creator/qt-creator
ManhattanStyle: Remove a hack for QComboBox wheel scrolling
Use Utils::setWheelScrollingWithoutFocusBlocked() explicitly when a QComboBox is placed inside a scroll area. The Utils::setWheelScrollingWithoutFocusBlocked() is more general and may be applied to other widgets, like QSpinBox. This patch brings back the wheel scrolling without a modifier key for combo boxes placed in dialogs. Keep the unconditional scroll wheel behavior when ctrl (meta on mac) modifier is pressed. Change-Id: Ieea0f228cea6b59e276bd3256eb6ea5ecc5b7d14 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -436,12 +436,6 @@ int ManhattanStyle::styleHint(StyleHint hint, const QStyleOption *option, const
|
||||
if (widget && widget->inherits("QTreeView"))
|
||||
ret = 0;
|
||||
break;
|
||||
case QStyle::SH_ComboBox_AllowWheelScrolling:
|
||||
// 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;
|
||||
case QStyle::SH_Slider_AbsoluteSetButtons:
|
||||
// Make QSlider jump on left mouse click
|
||||
ret = Qt::LeftButton | Qt::MiddleButton | Qt::RightButton;
|
||||
|
||||
Reference in New Issue
Block a user