mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-14 12:57:06 -05:00
Disable combobox scroll hijacking, and only show one event by default (rather than all)
This commit is contained in:
16
noscrollspinbox.cpp
Normal file
16
noscrollspinbox.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "noscrollspinbox.h"
|
||||
|
||||
NoScrollSpinBox::NoScrollSpinBox(QWidget *parent)
|
||||
: QSpinBox(parent)
|
||||
{
|
||||
// Don't let scrolling hijack focus.
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
}
|
||||
|
||||
void NoScrollSpinBox::wheelEvent(QWheelEvent *event)
|
||||
{
|
||||
// Only allow scrolling to modify contents when it explicitly has focus.
|
||||
if (hasFocus())
|
||||
QSpinBox::wheelEvent(event);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user