forked from qt-creator/qt-creator
GuiUtils: Rename attachWheelBlocker into setWheelScrollingWithoutFocusBlocked
This name corresponds better to e.g. SH_ComboBox_AllowWheelScrolling, SH_TabBar_AllowWheelScrolling or wheelScrollLines. Change-Id: I244774584e293ca45cc4be4d4526f925c2da9598 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -2343,7 +2343,7 @@ void IntegerAspect::addToLayout(Layouting::LayoutItem &parent)
|
|||||||
d->m_spinBox->setRange(int(d->m_minimumValue.value() / d->m_displayScaleFactor),
|
d->m_spinBox->setRange(int(d->m_minimumValue.value() / d->m_displayScaleFactor),
|
||||||
int(d->m_maximumValue.value() / d->m_displayScaleFactor));
|
int(d->m_maximumValue.value() / d->m_displayScaleFactor));
|
||||||
d->m_spinBox->setValue(int(value() / d->m_displayScaleFactor)); // Must happen after setRange()
|
d->m_spinBox->setValue(int(value() / d->m_displayScaleFactor)); // Must happen after setRange()
|
||||||
attachWheelBlocker(d->m_spinBox);
|
setWheelScrollingWithoutFocusBlocked(d->m_spinBox);
|
||||||
addLabeledItem(parent, d->m_spinBox);
|
addLabeledItem(parent, d->m_spinBox);
|
||||||
connect(d->m_spinBox.data(), &QSpinBox::valueChanged,
|
connect(d->m_spinBox.data(), &QSpinBox::valueChanged,
|
||||||
this, &IntegerAspect::handleGuiChanged);
|
this, &IntegerAspect::handleGuiChanged);
|
||||||
@@ -2443,7 +2443,7 @@ void DoubleAspect::addToLayout(LayoutItem &builder)
|
|||||||
d->m_spinBox->setSpecialValueText(d->m_specialValueText);
|
d->m_spinBox->setSpecialValueText(d->m_specialValueText);
|
||||||
if (d->m_maximumValue && d->m_maximumValue)
|
if (d->m_maximumValue && d->m_maximumValue)
|
||||||
d->m_spinBox->setRange(d->m_minimumValue.value(), d->m_maximumValue.value());
|
d->m_spinBox->setRange(d->m_minimumValue.value(), d->m_maximumValue.value());
|
||||||
attachWheelBlocker(d->m_spinBox);
|
setWheelScrollingWithoutFocusBlocked(d->m_spinBox);
|
||||||
bufferToGui(); // Must happen after setRange()!
|
bufferToGui(); // Must happen after setRange()!
|
||||||
addLabeledItem(builder, d->m_spinBox);
|
addLabeledItem(builder, d->m_spinBox);
|
||||||
connect(d->m_spinBox.data(), &QDoubleSpinBox::valueChanged,
|
connect(d->m_spinBox.data(), &QDoubleSpinBox::valueChanged,
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public:
|
|||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|
||||||
void QTCREATOR_UTILS_EXPORT attachWheelBlocker(QWidget *widget)
|
void QTCREATOR_UTILS_EXPORT setWheelScrollingWithoutFocusBlocked(QWidget *widget)
|
||||||
{
|
{
|
||||||
static Internal::WheelEventFilter instance;
|
static Internal::WheelEventFilter instance;
|
||||||
widget->installEventFilter(&instance);
|
widget->installEventFilter(&instance);
|
||||||
|
|||||||
@@ -9,6 +9,6 @@ class QWidget;
|
|||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
void QTCREATOR_UTILS_EXPORT attachWheelBlocker(QWidget *widget);
|
void QTCREATOR_UTILS_EXPORT setWheelScrollingWithoutFocusBlocked(QWidget *widget);
|
||||||
|
|
||||||
} // namespace Utils
|
} // namespace Utils
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ GeneralSettingsPageWidget::GeneralSettingsPageWidget()
|
|||||||
zoomSpinBox->setSingleStep(10);
|
zoomSpinBox->setSingleStep(10);
|
||||||
zoomSpinBox->setValue(100);
|
zoomSpinBox->setValue(100);
|
||||||
zoomSpinBox->setSuffix(Tr::tr("%"));
|
zoomSpinBox->setSuffix(Tr::tr("%"));
|
||||||
attachWheelBlocker(zoomSpinBox);
|
setWheelScrollingWithoutFocusBlocked(zoomSpinBox);
|
||||||
antialiasCheckBox = new QCheckBox(Tr::tr("Antialias"));
|
antialiasCheckBox = new QCheckBox(Tr::tr("Antialias"));
|
||||||
|
|
||||||
auto fontGroupBox = new QGroupBox(Tr::tr("Font"));
|
auto fontGroupBox = new QGroupBox(Tr::tr("Font"));
|
||||||
|
|||||||
Reference in New Issue
Block a user