2022-06-23 12:34:40 -07:00
|
|
|
#include "qclickablelabel.h"
|
|
|
|
|
|
|
|
QClickableLabel::QClickableLabel(QWidget* parent, Qt::WindowFlags f)
|
|
|
|
: QLabel(parent) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
QClickableLabel::~QClickableLabel() {}
|
|
|
|
|
2022-06-23 16:15:33 -07:00
|
|
|
void QClickableLabel::mousePressEvent(QMouseEvent * event) {
|
2022-06-23 12:34:40 -07:00
|
|
|
emit clicked();
|
2022-06-23 16:15:33 -07:00
|
|
|
QClickableLabel::setStyleSheet("color: white; background-color: black; border-radius: 10px; padding: 20px");
|
|
|
|
}
|
|
|
|
|
|
|
|
void QClickableLabel::mouseReleaseEvent(QMouseEvent * event) {
|
|
|
|
emit unclicked();
|
|
|
|
QClickableLabel::setStyleSheet("color: black; background-color: white; border-radius: 10px; padding: 20px");
|
2022-06-23 12:34:40 -07:00
|
|
|
}
|