forked from osmocom/wireshark
47 lines
951 B
C++
47 lines
951 B
C++
/* clickable_label.h
|
|
*
|
|
* 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_ */
|
|
|
|
/*
|
|
* Editor modelines
|
|
*
|
|
* Local Variables:
|
|
* c-basic-offset: 4
|
|
* tab-width: 8
|
|
* indent-tabs-mode: nil
|
|
* End:
|
|
*
|
|
* ex: set shiftwidth=4 tabstop=8 expandtab:
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
*/
|