mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-13 04:15:45 -05:00
Fix scrolling over UIntSpinBox
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "uintspinbox.h"
|
||||
#include <QWheelEvent>
|
||||
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user