yolobs-studio/UI/slider-ignorewheel.hpp

52 lines
1.1 KiB
C++
Raw Permalink Normal View History

2019-07-27 12:47:10 +00:00
#pragma once
2020-12-22 17:32:50 +00:00
#include "obs.hpp"
2019-07-27 12:47:10 +00:00
#include <QSlider>
#include <QInputEvent>
#include <QtCore/QObject>
2020-12-22 17:32:50 +00:00
#include <QAccessibleWidget>
2019-07-27 12:47:10 +00:00
class SliderIgnoreScroll : public QSlider {
Q_OBJECT
public:
SliderIgnoreScroll(QWidget *parent = nullptr);
2019-09-22 21:19:10 +00:00
SliderIgnoreScroll(Qt::Orientation orientation,
QWidget *parent = nullptr);
2019-07-27 12:47:10 +00:00
protected:
virtual void wheelEvent(QWheelEvent *event) override;
};
2020-12-22 17:32:50 +00:00
class VolumeSlider : public SliderIgnoreScroll {
Q_OBJECT
public:
obs_fader_t *fad;
VolumeSlider(obs_fader_t *fader, QWidget *parent = nullptr);
VolumeSlider(obs_fader_t *fader, Qt::Orientation orientation,
QWidget *parent = nullptr);
};
class VolumeAccessibleInterface : public QAccessibleWidget {
public:
VolumeAccessibleInterface(QWidget *w);
QVariant currentValue() const;
void setCurrentValue(const QVariant &value);
QVariant maximumValue() const;
QVariant minimumValue() const;
QVariant minimumStepSize() const;
private:
VolumeSlider *slider() const;
protected:
virtual QAccessible::Role role() const override;
virtual QString text(QAccessible::Text t) const override;
};