fix: allow scrolling by inputs in settings (#6128)

This commit is contained in:
nerix
2025-04-06 15:30:16 +02:00
committed by GitHub
parent edbdcc1d55
commit db6b33da61
4 changed files with 24 additions and 3 deletions
@@ -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);
+21 -1
View File
@@ -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();
}
};
+1 -1
View File
@@ -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());