fix: allow scrolling by inputs in settings (#6128)
This commit is contained in:
@@ -254,7 +254,7 @@ QSpinBox *GeneralPageView::addIntInput(const QString &text, IntSetting &setting,
|
||||
auto *label = new QLabel(text + ":");
|
||||
this->addToolTip(*label, toolTipText);
|
||||
|
||||
auto *input = new QSpinBox;
|
||||
auto *input = new SpinBox;
|
||||
input->setMinimum(min);
|
||||
input->setMaximum(max);
|
||||
|
||||
|
||||
@@ -76,9 +76,29 @@ class ComboBox : public QComboBox
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
protected:
|
||||
void wheelEvent(QWheelEvent *event) override
|
||||
{
|
||||
(void)event;
|
||||
event->ignore();
|
||||
}
|
||||
};
|
||||
|
||||
class SpinBox : public QSpinBox
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SpinBox(QWidget *parent = nullptr)
|
||||
: QSpinBox(parent)
|
||||
{
|
||||
// QAbstractSpinBox defaults to Qt::WheelFocus
|
||||
this->setFocusPolicy(Qt::StrongFocus);
|
||||
}
|
||||
|
||||
protected:
|
||||
void wheelEvent(QWheelEvent *event) override
|
||||
{
|
||||
event->ignore();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ SettingWidget *SettingWidget::intInput(const QString &label,
|
||||
|
||||
auto *lbl = new QLabel(label + ":");
|
||||
|
||||
auto *input = new QSpinBox;
|
||||
auto *input = new SpinBox;
|
||||
if (params.min.has_value())
|
||||
{
|
||||
input->setMinimum(params.min.value());
|
||||
|
||||
Reference in New Issue
Block a user