1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00
LibQQt/test/testmouselocker11/qqtmouselocker.h

45 lines
1.2 KiB
C
Raw Normal View History

#ifndef QQTMOUSELOCKER_H
#define QQTMOUSELOCKER_H
#include <QObject>
//#include "qqt-local.h"
#define QQTSHARED_EXPORT
/**
* @brief The QQtMouseLocker class
*
*
* 使
* QWidget* w;//需要锁定鼠标的窗口。
* w->setMouseTracking(True);//必要
* //w->setFocusPolicy(Qt::StrongFocus);//不必要设置Focus。
* QQtFrameMouseLocker* helper = new QQtFrameMouseLocker(parent) ;
* w->installEventFilter(helper);//一步设置即可。
* 使
*
*
* move的时候
* QWidget及其子类QMainWindow
* windowsmacOSLinux等桌面操作系统
*/
class QQtMouseLockerPrivate;
class QQTSHARED_EXPORT QQtMouseLocker : public QObject
{
Q_OBJECT
public:
QQtMouseLocker ( QObject* parent = 0 );
~QQtMouseLocker();
// QObject interface
public:
virtual bool eventFilter ( QObject* watched, QEvent* event ) override;
private:
QQtMouseLockerPrivate* d_ptr;
Q_DECLARE_PRIVATE ( QQtMouseLocker )
};
#endif // QQTMOUSELOCKER_H