1 Star 1 Fork 1

tgtsml/QtScreenshot

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
MainWindow.h 1.31 KB
一键复制 编辑 原始数据 按行查看 历史
tgtsml 提交于 2020-10-19 00:50 +08:00 . add key press event: escape key
/*************************************************************************
*
* This file is part of tgtsml_tools
*
* Create Date 2020/10/18
*
* Copyright: tgtsml
*
* Contact email: [email protected]
*
* GitHub: www.github.com/tgtsml
*
*************************************************************************/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QSystemTrayIcon>
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
protected:
void showEvent(QShowEvent *);
void paintEvent(QPaintEvent *);
void mouseMoveEvent(QMouseEvent *event);
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void contextMenuEvent(QContextMenuEvent *event);
void keyPressEvent(QKeyEvent *event);
private:
bool m_isMousePressed;
QPixmap *m_screenPicture;
QPixmap *backgroundPicture;
QPoint m_startPos, m_endPos;
QMenu *m_screenMenu, *m_trayMenu;
private:
QRect getCapturedRect(QPoint startpos, QPoint endpos);
void clearScreenCaptureInfo();
QString getSaveFileName();
void activateTrayIcon(QSystemTrayIcon::ActivationReason reason);
private:
void slot_saveCapturedScreen();
void slot_saveFullScreen();
};
#endif // MAINWINDOW_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/tgtsml/QtScreenshot.git
[email protected]:tgtsml/QtScreenshot.git
tgtsml
QtScreenshot
QtScreenshot
master

搜索帮助