-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finished feature double click on Album (#253)
* finished feature double click on Album. With these changes the labels for name and artist of a song are clickable and you can go directly with one click to the album or artist * added forgotten files
- Loading branch information
Showing
5 changed files
with
78 additions
and
2 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "clickableLabel.hpp" | ||
|
||
ClickableLabel::ClickableLabel(QWidget* parent, Qt::WindowFlags f) | ||
: QLabel(parent) { | ||
|
||
} | ||
|
||
ClickableLabel::~ClickableLabel() {} | ||
|
||
void ClickableLabel::mousePressEvent(QMouseEvent* event) { | ||
if(event->button() == Qt::LeftButton){ | ||
emit clicked(); | ||
} | ||
QLabel::mousePressEvent(event); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#ifndef CLICKABLELABEL_H | ||
#define CLICKABLELABEL_H | ||
|
||
#include <QLabel> | ||
#include <QWidget> | ||
#include <Qt> | ||
#include <QMouseEvent> | ||
|
||
class ClickableLabel : public QLabel { | ||
Q_OBJECT | ||
|
||
public: | ||
explicit ClickableLabel(QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()); | ||
~ClickableLabel(); | ||
|
||
signals: | ||
void clicked(); | ||
|
||
protected: | ||
void mousePressEvent(QMouseEvent* event) override; | ||
|
||
}; | ||
|
||
#endif // CLICKABLELABEL_H |
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
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