annotate widgets/ClickableLabel.h @ 738:d26545a2a02d tonioni

Rather than undrawing the bottom bit of the dial, don't draw it in the first place (necessary on shaded background)
author Chris Cannam
date Thu, 06 Mar 2014 13:52:33 +0000
parents 666cdcae5f0d
children a18e78b9c78b
rev   line source
Chris@500 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@500 2
Chris@500 3 /*
Chris@500 4 Sonic Visualiser
Chris@500 5 An audio file viewer and annotation editor.
Chris@500 6 Centre for Digital Music, Queen Mary, University of London.
Chris@500 7
Chris@500 8 This program is free software; you can redistribute it and/or
Chris@500 9 modify it under the terms of the GNU General Public License as
Chris@500 10 published by the Free Software Foundation; either version 2 of the
Chris@500 11 License, or (at your option) any later version. See the file
Chris@500 12 COPYING included with this distribution for more information.
Chris@500 13 */
Chris@500 14
Chris@500 15 #ifndef _CLICKABLE_LABEL_H_
Chris@500 16 #define _CLICKABLE_LABEL_H_
Chris@500 17
Chris@500 18 #include <QLabel>
Chris@500 19
Chris@500 20 class ClickableLabel : public QLabel
Chris@500 21 {
Chris@500 22 Q_OBJECT
Chris@500 23
Chris@500 24 public:
Chris@500 25 ClickableLabel(const QString &text, QWidget *parent = 0) :
Chris@500 26 QLabel(text, parent) { }
Chris@500 27 ClickableLabel(QWidget *parent = 0) : QLabel(parent) { }
Chris@500 28 ~ClickableLabel() { }
Chris@500 29
Chris@500 30 signals:
Chris@500 31 void clicked();
Chris@500 32
Chris@500 33 protected:
Chris@500 34 virtual void mousePressEvent(QMouseEvent *) {
Chris@500 35 emit clicked();
Chris@500 36 }
Chris@500 37 };
Chris@500 38
Chris@500 39 #endif