blob: f958a4d4db5172303d9867d0047415f6560e56c4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/** @file
*
* Taken from https://wiki.qt.io/Clickable_QLabel and adapted for usage
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef CLICKABLE_LABEL_H_
#define CLICKABLE_LABEL_H_
#include <QLabel>
class ClickableLabel : public QLabel
{
Q_OBJECT
public:
explicit ClickableLabel(QWidget* parent=0);
signals:
void clicked();
void clickedAt(const QPoint &global_pos, Qt::MouseButton button);
protected:
void mouseReleaseEvent(QMouseEvent* event);
void mousePressEvent(QMouseEvent *event);
void contextMenuEvent(QContextMenuEvent *event);
};
#endif /* CLICKABLE_LABEL_H_ */
|