14 lines
287 B
C++
14 lines
287 B
C++
#include "spinbox-ignorewheel.hpp"
|
|
|
|
SpinBoxIgnoreScroll::SpinBoxIgnoreScroll(QWidget *parent) : QSpinBox(parent)
|
|
{
|
|
setFocusPolicy(Qt::StrongFocus);
|
|
}
|
|
|
|
void SpinBoxIgnoreScroll::wheelEvent(QWheelEvent *event)
|
|
{
|
|
if (!hasFocus())
|
|
event->ignore();
|
|
else
|
|
QSpinBox::wheelEvent(event);
|
|
}
|