quill/qclickablelabel.cpp

20 lines
602 B
C++
Raw Normal View History

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