9249403c96
Ignore wheelEvent using subclass slider,spinbox,combobox with eventhandlers: wheelEvent - ignore if widget is not focused, leaveEvent - clear focus when mouse leaves event. Use these new subclass widgets in properties to ignore wheelEvent when scrolling.
21 lines
318 B
C++
21 lines
318 B
C++
#pragma once
|
|
|
|
#include <QSlider>
|
|
#include <QInputEvent>
|
|
#include <QtCore/QObject>
|
|
|
|
|
|
class SliderIgnoreScroll : public QSlider {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
SliderIgnoreScroll(QWidget *parent = nullptr);
|
|
|
|
protected:
|
|
|
|
virtual void wheelEvent(QWheelEvent *event) override;
|
|
virtual void leaveEvent(QEvent *event) override;
|
|
};
|
|
|
|
|