Added "custom parameters" options for Opus. Also added a "help" button for all "custo...
[LameXP.git] / src / CustomEventFilter.h
blob552f9f4f767b51bba459802109fe51ed4e4c1fd8
1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2012 LoRd_MuldeR <MuldeR2@GMX.de>
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License along
16 // with this program; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 // http://www.gnu.org/licenses/gpl-2.0.txt
20 ///////////////////////////////////////////////////////////////////////////////
22 #include <QEvent>
23 #include <QObject>
25 class CustomEventFilter: public QObject
27 Q_OBJECT
29 public:
30 CustomEventFilter(void) {}
32 bool eventFilter(QObject *obj, QEvent *event)
34 if(obj != this)
36 switch(event->type())
38 case QEvent::MouseButtonPress:
39 emit clicked(obj);
40 break;
41 case QEvent::Enter:
42 emit mouseEntered(obj);
43 break;
44 case QEvent::Leave:
45 emit mouseLeft(obj);
46 break;
50 return false;
53 signals:
54 void clicked(QObject *sender);
55 void mouseEntered(QObject *sender);
56 void mouseLeft(QObject *sender);