Created
June 11, 2014 14:46
-
-
Save jjfajardo/545e72dae11ca6d7b6d8 to your computer and use it in GitHub Desktop.
LinkLabel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "linklabel.h" | |
#include <QtWidgets> | |
LinkLabel::LinkLabel(QWidget * parent) | |
:QLabel(parent) | |
{ | |
connect( this, SIGNAL( clicked() ), this, SLOT( slotClicked() ) ); | |
} | |
void LinkLabel::slotClicked() | |
{ | |
qDebug()<<"Clicked"; | |
} | |
void LinkLabel::mousePressEvent ( QMouseEvent * event ) | |
{ | |
emit clicked(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef LINKLABEL_H | |
#define LINKLABEL_H | |
#include <QLabel> | |
class LinkLabel : public QLabel | |
{ | |
Q_OBJECT | |
public: | |
LinkLabel(QWidget * parent = 0 ); | |
~LinkLabel(){} | |
signals: | |
void clicked(); | |
public slots: | |
void slotClicked(); | |
protected: | |
void mousePressEvent ( QMouseEvent * event ) ; | |
}; | |
#endif // LINKLABEL_H |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment