6 changed files with 54 additions and 14 deletions
@ -0,0 +1,15 @@ |
|||||||
|
#include "dockwidgettitlebareventfilter.h" |
||||||
|
#include <QDebug> |
||||||
|
#include <QEvent> |
||||||
|
DockWidgetTitleBarEventFilter::DockWidgetTitleBarEventFilter(QObject *parent) : QObject(parent) |
||||||
|
{ |
||||||
|
} |
||||||
|
bool DockWidgetTitleBarEventFilter::eventFilter(QObject *object,QEvent *event) |
||||||
|
{ |
||||||
|
qDebug() << event->type(); |
||||||
|
if (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonRelease) |
||||||
|
{ |
||||||
|
return true; |
||||||
|
} |
||||||
|
return QObject::eventFilter(object,event); |
||||||
|
} |
@ -0,0 +1,19 @@ |
|||||||
|
#ifndef DOCKWIDGETTITLEBAREVENTFILTER_H |
||||||
|
#define DOCKWIDGETTITLEBAREVENTFILTER_H |
||||||
|
|
||||||
|
#include <QObject> |
||||||
|
|
||||||
|
class DockWidgetTitleBarEventFilter : public QObject |
||||||
|
{ |
||||||
|
Q_OBJECT |
||||||
|
public: |
||||||
|
explicit DockWidgetTitleBarEventFilter(QObject *parent = 0); |
||||||
|
protected: |
||||||
|
bool eventFilter(QObject *object,QEvent *event); |
||||||
|
signals: |
||||||
|
|
||||||
|
public slots: |
||||||
|
|
||||||
|
}; |
||||||
|
|
||||||
|
#endif // DOCKWIDGETTITLEBAREVENTFILTER_H
|
Loading…
Reference in new issue