1 Star 1 Fork 7

ciyeer/easy-capture

forked from xinhecuican/easy-capture 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
MainFilter.h 1.24 KB
一键复制 编辑 原始数据 按行查看 历史
#ifndef MAIN_FLITER_H
#define MAIN_FLITER_H
#include <QWidget>
#include "QAbstractNativeEventFilter"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "Style_widget/tray.h"
#include <QProcess>
/**
* @brief The MainFilter class
* 用于注册快捷键,全局快捷键和托盘,它会处理全局快捷键事件,并且将本进程的键盘事件传递给@ref KeyManager
* 此外还会检查更新及启用定时器来调用 @ref WindowManager::controlWindowClose()
*/
class MainFilter : public QWidget, public QAbstractNativeEventFilter {
Q_OBJECT
public:
MainFilter();
~MainFilter();
static MainFilter* instance() {
if(_instance == NULL) {
_instance = new MainFilter();
}
return _instance;
}
bool eventFilter(QObject* o, QEvent* e)override;
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result)override;
void stopTimer();
void startTimer();
bool isTimerRun();
ATOM global_key_id;
ATOM global_capture_id;
public slots:
void windowMnaagerThread();
private:
void setTrayContextMenu();
void checkCrash();
Tray* tray;
QTimer* timer;
static MainFilter* _instance;
QProcess* crashUploadProcess;
};
#endif // MAIN_FLITER_H
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/ciyeer/easy-capture.git
git@gitee.com:ciyeer/easy-capture.git
ciyeer
easy-capture
easy-capture
master

搜索帮助