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