Chris@1188: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
Chris@1188: 
Chris@1188: /*
Chris@1188:     Sonic Visualiser
Chris@1188:     An audio file viewer and annotation editor.
Chris@1188:     Centre for Digital Music, Queen Mary, University of London.
Chris@1188:     This file copyright 2007 QMUL.
Chris@1188:     
Chris@1188:     This program is free software; you can redistribute it and/or
Chris@1188:     modify it under the terms of the GNU General Public License as
Chris@1188:     published by the Free Software Foundation; either version 2 of the
Chris@1188:     License, or (at your option) any later version.  See the file
Chris@1188:     COPYING included with this distribution for more information.
Chris@1188: */
Chris@1188: 
Chris@1188: #ifndef SV_NOTIFYING_TOOL_BUTTON_H
Chris@1188: #define SV_NOTIFYING_TOOL_BUTTON_H
Chris@1188: 
Chris@1188: #include <QToolButton>
Chris@1188: 
Chris@1188: /**
Chris@1188:  * Very trivial enhancement to QToolButton to make it emit signals
Chris@1188:  * when the mouse enters and leaves (for context help). See also
Chris@1188:  * NotifyingPushButton
Chris@1188:  */
Chris@1188: 
Chris@1188: class NotifyingToolButton : public QToolButton
Chris@1188: {
Chris@1188:     Q_OBJECT
Chris@1188: 
Chris@1188: public:
Chris@1188:     NotifyingToolButton(QWidget *parent = 0) :
Chris@1188:         QToolButton(parent) { }
Chris@1188: 
Chris@1188:     virtual ~NotifyingToolButton();
Chris@1188: 
Chris@1188: signals:
Chris@1188:     void mouseEntered();
Chris@1188:     void mouseLeft();
Chris@1188: 
Chris@1188: protected:
Chris@1406:     void enterEvent(QEvent *) override;
Chris@1406:     void leaveEvent(QEvent *) override;
Chris@1188: };
Chris@1188: 
Chris@1188: #endif
Chris@1188: