annotate widgets/ClickableLabel.h @ 1447:8afea53332f3 single-point

Add option to make pane sizes auto-resize-only (i.e. remove user control via a splitter); also place alignment views above panes instead of below, meaning the extra bit of space that we currently have for the pane without one at least goes to the primary pane
author Chris Cannam
date Tue, 30 Apr 2019 15:53:21 +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