25 lines
624 B
C++
25 lines
624 B
C++
#include "qratiobutton.h"
|
|
|
|
QRatioButton::QRatioButton(const quint8 &row, const quint8 &column, QWidget *parent) : QPushButton(parent)
|
|
{
|
|
this->setCheckable(true);
|
|
QSizePolicy sizePolicy(QSizePolicy::Policy::MinimumExpanding, QSizePolicy::Policy::MinimumExpanding);
|
|
sizePolicy.setHeightForWidth(true);
|
|
this->setSizePolicy(sizePolicy);
|
|
|
|
this->row = row;
|
|
this->column = column;
|
|
|
|
QObject::connect(this, &QPushButton::pressed, this, &QRatioButton::onButtonPressSignal);
|
|
}
|
|
|
|
int QRatioButton::heightForWidth(int w) const
|
|
{
|
|
return w;
|
|
}
|
|
|
|
void QRatioButton::onButtonPressSignal()
|
|
{
|
|
emit this->pressedRowColumn(row, column);
|
|
}
|