annotate widgets/NotifyingToolButton.h @ 1522:d5ef91dc2ea7

Merge from branch time-frequency-boxes
author Chris Cannam
date Wed, 25 Sep 2019 13:48:04 +0100
parents a18e78b9c78b
children
rev   line source
Chris@1188 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@1188 2
Chris@1188 3 /*
Chris@1188 4 Sonic Visualiser
Chris@1188 5 An audio file viewer and annotation editor.
Chris@1188 6 Centre for Digital Music, Queen Mary, University of London.
Chris@1188 7 This file copyright 2007 QMUL.
Chris@1188 8
Chris@1188 9 This program is free software; you can redistribute it and/or
Chris@1188 10 modify it under the terms of the GNU General Public License as
Chris@1188 11 published by the Free Software Foundation; either version 2 of the
Chris@1188 12 License, or (at your option) any later version. See the file
Chris@1188 13 COPYING included with this distribution for more information.
Chris@1188 14 */
Chris@1188 15
Chris@1188 16 #ifndef SV_NOTIFYING_TOOL_BUTTON_H
Chris@1188 17 #define SV_NOTIFYING_TOOL_BUTTON_H
Chris@1188 18
Chris@1188 19 #include <QToolButton>
Chris@1188 20
Chris@1188 21 /**
Chris@1188 22 * Very trivial enhancement to QToolButton to make it emit signals
Chris@1188 23 * when the mouse enters and leaves (for context help). See also
Chris@1188 24 * NotifyingPushButton
Chris@1188 25 */
Chris@1188 26
Chris@1188 27 class NotifyingToolButton : public QToolButton
Chris@1188 28 {
Chris@1188 29 Q_OBJECT
Chris@1188 30
Chris@1188 31 public:
Chris@1188 32 NotifyingToolButton(QWidget *parent = 0) :
Chris@1188 33 QToolButton(parent) { }
Chris@1188 34
Chris@1188 35 virtual ~NotifyingToolButton();
Chris@1188 36
Chris@1188 37 signals:
Chris@1188 38 void mouseEntered();
Chris@1188 39 void mouseLeft();
Chris@1188 40
Chris@1188 41 protected:
Chris@1406 42 void enterEvent(QEvent *) override;
Chris@1406 43 void leaveEvent(QEvent *) override;
Chris@1188 44 };
Chris@1188 45
Chris@1188 46 #endif
Chris@1188 47