1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00
LibQQt/test/testbodyresizer/qqtbodyresizer.h
tianduanrui 4aa199b715 add qqtbodyresizer.
remove qqtframelesshelper
2019-08-25 16:28:08 +08:00

47 lines
1.3 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef QQTBODYRESIZER_H
#define QQTBODYRESIZER_H
#include <QObject>
//#include "qqt-local.h"
#define QQTSHARED_EXPORT
/**
* @brief The QQtBodyResizer class
* 摁住窗体的边缘就能伸缩窗体。
*
* 使用方法:
* QWidget* w;//需要实现功能的窗口。
* w->setMouseTracking(True);//必要 !!!
* //w->setFocusPolicy(Qt::StrongFocus);//不必要设置Focus。
* QQtBodyResizer* helper = new QQtBodyResizer(parent) ;
* w->installEventFilter(helper);//一步设置即可。
* 允许使用这一个句柄为多个窗口安装,各自独立工作,互不干扰。
*
* 工作原理:
* 鼠标在窗口边缘的时候,截获鼠标消息,使窗口伸缩。
* 支持所有QWidget及其子类不支持QMainWindow。
* 支持windows、macOS、Linux、e-linux等操作系统。
*
* 有很严重的抖动,而且必须慢慢的改变大小。
*/
class QQtBodyResizerPrivate;
class QQTSHARED_EXPORT QQtBodyResizer : public QObject
{
Q_OBJECT
public:
QQtBodyResizer ( QObject* parent = 0 );
~QQtBodyResizer();
// QObject interface
public:
virtual bool eventFilter ( QObject* watched, QEvent* event ) override;
private:
QQtBodyResizerPrivate* d_ptr;
Q_DECLARE_PRIVATE ( QQtBodyResizer )
};
#endif // QQTBODYRESIZER_H