yolobs-studio/UI/slider-ignorewheel.cpp
2019-09-22 23:19:10 +02:00

22 lines
465 B
C++

#include "slider-ignorewheel.hpp"
SliderIgnoreScroll::SliderIgnoreScroll(QWidget *parent) : QSlider(parent)
{
setFocusPolicy(Qt::StrongFocus);
}
SliderIgnoreScroll::SliderIgnoreScroll(Qt::Orientation orientation,
QWidget *parent)
: QSlider(parent)
{
setFocusPolicy(Qt::StrongFocus);
setOrientation(orientation);
}
void SliderIgnoreScroll::wheelEvent(QWheelEvent *event)
{
if (!hasFocus())
event->ignore();
else
QSlider::wheelEvent(event);
}