mirror of
https://github.com/huderlem/porymap.git
synced 2026-03-22 01:54:46 -05:00
17 lines
378 B
C++
17 lines
378 B
C++
#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);
|
|
}
|
|
|