svgui
1.9
|
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 00002 00003 /* 00004 Sonic Visualiser 00005 An audio file viewer and annotation editor. 00006 Centre for Digital Music, Queen Mary, University of London. 00007 00008 This program is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU General Public License as 00010 published by the Free Software Foundation; either version 2 of the 00011 License, or (at your option) any later version. See the file 00012 COPYING included with this distribution for more information. 00013 */ 00014 00015 #ifndef _CLICKABLE_LABEL_H_ 00016 #define _CLICKABLE_LABEL_H_ 00017 00018 #include <QLabel> 00019 00020 class ClickableLabel : public QLabel 00021 { 00022 Q_OBJECT 00023 00024 public: 00025 ClickableLabel(const QString &text, QWidget *parent = 0) : 00026 QLabel(text, parent) { } 00027 ClickableLabel(QWidget *parent = 0) : QLabel(parent) { } 00028 ~ClickableLabel() { } 00029 00030 signals: 00031 void clicked(); 00032 00033 protected: 00034 virtual void mousePressEvent(QMouseEvent *) { 00035 emit clicked(); 00036 } 00037 }; 00038 00039 #endif