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@189: #ifndef _NOTIFYING_CHECK_BOX_H_
Chris@189: #define _NOTIFYING_CHECK_BOX_H_
Chris@189: 
Chris@189: #include <QCheckBox>
Chris@189: 
Chris@189: /**
Chris@189:  * Very trivial enhancement to QCheckBox to make it emit signals when
Chris@189:  * the mouse enters and leaves (for context help).
Chris@189:  */
Chris@189: 
Chris@189: class NotifyingCheckBox : public QCheckBox
Chris@189: {
Chris@189:     Q_OBJECT
Chris@189: public:
Chris@189: 
Chris@189:     NotifyingCheckBox(QWidget *parent = 0) :
Chris@189:         QCheckBox(parent) { }
Chris@189: 
Chris@189:     virtual ~NotifyingCheckBox();
Chris@189: 
Chris@189: signals:
Chris@189:     void mouseEntered();
Chris@189:     void mouseLeft();
Chris@189: 
Chris@189: protected:
Chris@189:     virtual void enterEvent(QEvent *);
Chris@189:     virtual void leaveEvent(QEvent *);
Chris@189: };
Chris@189: 
Chris@189: #endif
Chris@189: