23 lines
456 B
C++
23 lines
456 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);
|
||
|
}
|