From d3a34cf5fc448eab23a13b5268eb88db276bf4a5 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 19 Nov 2024 21:18:55 -0500 Subject: [PATCH] Fix scrolling over UIntSpinBox --- src/ui/uintspinbox.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ui/uintspinbox.cpp b/src/ui/uintspinbox.cpp index 789a1662..53f6df78 100644 --- a/src/ui/uintspinbox.cpp +++ b/src/ui/uintspinbox.cpp @@ -1,4 +1,5 @@ #include "uintspinbox.h" +#include UIntSpinBox::UIntSpinBox(QWidget *parent) : QAbstractSpinBox(parent) @@ -178,8 +179,11 @@ QAbstractSpinBox::StepEnabled UIntSpinBox::stepEnabled() const { void UIntSpinBox::wheelEvent(QWheelEvent *event) { // Only allow scrolling to modify contents when it explicitly has focus. - if (hasFocus()) + if (hasFocus()) { QAbstractSpinBox::wheelEvent(event); + } else { + event->ignore(); + } } void UIntSpinBox::focusOutEvent(QFocusEvent *event) {