2019-04-21 04:10:46 -07:00
|
|
|
#include "spinbox-ignorewheel.hpp"
|
2019-04-06 20:56:52 -04:00
|
|
|
|
|
|
|
SpinBoxIgnoreScroll::SpinBoxIgnoreScroll(QWidget *parent) : QSpinBox(parent)
|
|
|
|
{
|
|
|
|
setFocusPolicy(Qt::StrongFocus);
|
|
|
|
}
|
|
|
|
|
2019-04-21 04:05:51 -07:00
|
|
|
void SpinBoxIgnoreScroll::wheelEvent(QWheelEvent *event)
|
2019-04-06 20:56:52 -04:00
|
|
|
{
|
|
|
|
if (!hasFocus())
|
|
|
|
event->ignore();
|
|
|
|
else
|
|
|
|
QSpinBox::wheelEvent(event);
|
|
|
|
}
|