|
|
|
@ -226,20 +226,25 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) :
@@ -226,20 +226,25 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) :
|
|
|
|
|
connect(bodyUI->cbDontGroupWindows, &QCheckBox::stateChanged, this, &GeneralForm::onDontGroupWindowsChanged); |
|
|
|
|
connect(bodyUI->cbGroupchatPosition, &QCheckBox::stateChanged, this, &GeneralForm::onGroupchatPositionChanged); |
|
|
|
|
|
|
|
|
|
// prevent stealing mouse whell scroll
|
|
|
|
|
// prevent stealing mouse wheel scroll
|
|
|
|
|
// scrolling event won't be transmitted to comboboxes or qspinboxes when scrolling
|
|
|
|
|
// you can scroll through general settings without accidentially chaning theme/skin/icons etc.
|
|
|
|
|
// @see GeneralForm::eventFilter(QObject *o, QEvent *e) at the bottom of this file for more
|
|
|
|
|
for (QComboBox* cb : findChildren<QComboBox*>()) |
|
|
|
|
for (QComboBox *cb : findChildren<QComboBox*>()) |
|
|
|
|
{ |
|
|
|
|
cb->installEventFilter(this); |
|
|
|
|
cb->setFocusPolicy(Qt::StrongFocus); |
|
|
|
|
cb->installEventFilter(this); |
|
|
|
|
cb->setFocusPolicy(Qt::StrongFocus); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (QSpinBox* sp : findChildren<QSpinBox*>()) |
|
|
|
|
for (QSpinBox *sp : findChildren<QSpinBox*>()) |
|
|
|
|
{ |
|
|
|
|
sp->installEventFilter(this); |
|
|
|
|
sp->setFocusPolicy(Qt::WheelFocus); |
|
|
|
|
sp->installEventFilter(this); |
|
|
|
|
sp->setFocusPolicy(Qt::WheelFocus); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (QCheckBox *cb : findChildren<QCheckBox*>()) // this one is to allow scrolling on checkboxes
|
|
|
|
|
{ |
|
|
|
|
cb->installEventFilter(this); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifndef QTOX_PLATFORM_EXT |
|
|
|
@ -508,7 +513,7 @@ void GeneralForm::onThemeColorChanged(int)
@@ -508,7 +513,7 @@ void GeneralForm::onThemeColorChanged(int)
|
|
|
|
|
bool GeneralForm::eventFilter(QObject *o, QEvent *e) |
|
|
|
|
{ |
|
|
|
|
if ((e->type() == QEvent::Wheel) && |
|
|
|
|
(qobject_cast<QComboBox*>(o) || qobject_cast<QAbstractSpinBox*>(o) )) |
|
|
|
|
(qobject_cast<QComboBox*>(o) || qobject_cast<QAbstractSpinBox*>(o) || qobject_cast<QCheckBox*>(o))) |
|
|
|
|
{ |
|
|
|
|
e->ignore(); |
|
|
|
|
return true; |
|
|
|
|