annotate widgets/ClickableLabel.h @ 1531:084c591622c5

Slightly streamline image scaling
author Chris Cannam
date Wed, 09 Oct 2019 11:17:26 +0100
parents 05d614f6e46d
children
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@1407 15 #ifndef SV_CLICKABLE_LABEL_H
Chris@1407 16 #define SV_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@1406 34 void mousePressEvent(QMouseEvent *) override {
Chris@500 35 emit clicked();
Chris@500 36 }
Chris@500 37 };
Chris@500 38
Chris@500 39 #endif