Chris@500: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
Chris@500: 
Chris@500: /*
Chris@500:     Sonic Visualiser
Chris@500:     An audio file viewer and annotation editor.
Chris@500:     Centre for Digital Music, Queen Mary, University of London.
Chris@500:     
Chris@500:     This program is free software; you can redistribute it and/or
Chris@500:     modify it under the terms of the GNU General Public License as
Chris@500:     published by the Free Software Foundation; either version 2 of the
Chris@500:     License, or (at your option) any later version.  See the file
Chris@500:     COPYING included with this distribution for more information.
Chris@500: */
Chris@500: 
Chris@500: #ifndef _CLICKABLE_LABEL_H_
Chris@500: #define _CLICKABLE_LABEL_H_
Chris@500: 
Chris@500: #include <QLabel>
Chris@500: 
Chris@500: class ClickableLabel : public QLabel
Chris@500: {
Chris@500:     Q_OBJECT
Chris@500: 
Chris@500: public:
Chris@500:     ClickableLabel(const QString &text, QWidget *parent = 0) :
Chris@500:         QLabel(text, parent) { }
Chris@500:     ClickableLabel(QWidget *parent = 0) : QLabel(parent) { }
Chris@500:     ~ClickableLabel() { }
Chris@500: 
Chris@500: signals:
Chris@500:     void clicked();
Chris@500: 
Chris@500: protected:
Chris@500:     virtual void mousePressEvent(QMouseEvent *) {
Chris@500:         emit clicked();
Chris@500:     }
Chris@500: };
Chris@500: 
Chris@500: #endif