34 lines
559 B
C++
34 lines
559 B
C++
#ifndef QRATIOBUTTON_H
|
|
#define QRATIOBUTTON_H
|
|
|
|
#include <QPushButton>
|
|
|
|
class QRatioButton : public QPushButton
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
enum class Type : quint8 {
|
|
INVALID,
|
|
PUSH_BUTTON,
|
|
DIAL
|
|
};
|
|
|
|
QRatioButton(const quint8 &row, const quint8 &column, QWidget *parent = nullptr);
|
|
|
|
virtual int heightForWidth(int w) const;
|
|
|
|
virtual Type type() const { return Type::INVALID; }
|
|
|
|
private:
|
|
void onButtonPressSignal();
|
|
|
|
quint8 row = 0;
|
|
quint8 column = 0;
|
|
|
|
signals:
|
|
void pressedRowColumn(const quint8 &row, const quint8 &column);
|
|
};
|
|
|
|
#endif // QRATIOBUTTON_H
|