2012-07-29 22:55:02 +02:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// LameXP - Audio Encoder Front-End
|
|
|
|
// Copyright (C) 2004-2012 LoRd_MuldeR <MuldeR2@GMX.de>
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation; either version 2 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License along
|
|
|
|
// with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
//
|
|
|
|
// http://www.gnu.org/licenses/gpl-2.0.txt
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2012-07-30 21:44:44 +02:00
|
|
|
#pragma once
|
|
|
|
|
2012-07-29 22:55:02 +02:00
|
|
|
#include <QEvent>
|
2012-07-30 21:44:44 +02:00
|
|
|
#include <QWidget>
|
2012-07-29 22:55:02 +02:00
|
|
|
|
|
|
|
class CustomEventFilter: public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
CustomEventFilter(void) {}
|
2012-07-30 21:44:44 +02:00
|
|
|
~CustomEventFilter(void) {}
|
2012-07-29 22:55:02 +02:00
|
|
|
|
|
|
|
bool eventFilter(QObject *obj, QEvent *event)
|
|
|
|
{
|
2012-07-30 21:44:44 +02:00
|
|
|
if(QWidget *sender = dynamic_cast<QWidget*>(obj))
|
2012-07-29 22:55:02 +02:00
|
|
|
{
|
|
|
|
switch(event->type())
|
|
|
|
{
|
|
|
|
case QEvent::Enter:
|
|
|
|
case QEvent::Leave:
|
2012-07-30 21:44:44 +02:00
|
|
|
case QEvent::KeyPress:
|
|
|
|
case QEvent::KeyRelease:
|
|
|
|
case QEvent::MouseButtonPress:
|
|
|
|
case QEvent::MouseButtonRelease:
|
|
|
|
case QEvent::FocusIn:
|
|
|
|
case QEvent::FocusOut:
|
|
|
|
case QEvent::TouchEnd:
|
|
|
|
eventOccurred(sender, event);
|
2012-07-29 22:55:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
signals:
|
2012-07-30 21:44:44 +02:00
|
|
|
void eventOccurred(QWidget *sender, QEvent *event);
|
2012-07-29 22:55:02 +02:00
|
|
|
};
|