TTKMusicPlayer  4.1.3.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
ttkclickedlabel.cpp
Go to the documentation of this file.
1 #include "ttkclickedlabel.h"
2 
3 #include <QMouseEvent>
4 
6  : QLabel(parent)
7  , m_blockOption(false)
8 {
9  setCursor(Qt::PointingHandCursor);
10 }
11 
12 TTKClickedLabel::TTKClickedLabel(const QString &text, QWidget *parent)
13  : QLabel(text, parent)
14  , m_blockOption(false)
15 {
16  setCursor(Qt::PointingHandCursor);
17 }
18 
19 void TTKClickedLabel::mousePressEvent(QMouseEvent *event)
20 {
21 // QLabel::mousePressEvent(event);
22  if(event->button() == Qt::LeftButton && !m_blockOption)
23  {
24  Q_EMIT clicked();
25  }
26 }
TTKClickedLabel(QWidget *parent=nullptr)
virtual void mousePressEvent(QMouseEvent *event) overridefinal