0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-19 20:32:15 +02:00
obs-studio/UI/mute-checkbox.hpp

25 lines
469 B
C++

#pragma once
#include <QCheckBox>
class MuteCheckBox : public QCheckBox {
Q_OBJECT
public:
MuteCheckBox(QWidget *parent = nullptr) : QCheckBox(parent)
{
setTristate(true);
}
protected:
/* While we need it to be tristate internally, we don't want a user being
* able to manually get into the partial state. */
void nextCheckState() override
{
if (checkState() != Qt::Checked)
setCheckState(Qt::Checked);
else
setCheckState(Qt::Unchecked);
}
};