This repository has been archived by the owner on Oct 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathscreenshottool.h
93 lines (63 loc) · 1.64 KB
/
screenshottool.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#ifndef SCREENSHOTTOOL_H
#define SCREENSHOTTOOL_H
/*
* Author:qiuzhiqian
* Email:[email protected]
* Github:https://github.com/qiuzhiqian
* Date:2017.07.23
**/
#include <QWidget>
#include <QDialog>
#include <QScreen>
#include <QPixmap>
#include <QMouseEvent>
#include <QDesktopWidget>
#include <QSystemTrayIcon>
#include <QMenu>
#include "canvas.h"
#include "hotkeybar.h"
#include "qxtglobalshortcut.h"
namespace Ui {
class ScreenShotTool;
}
class ScreenShotTool : public QWidget
{
Q_OBJECT
public:
explicit ScreenShotTool(QWidget *parent = 0);
~ScreenShotTool();
void initTray(); //初始化托盘
void ss_start(); //开始截图
void setHotKey();
void setAutoRun(bool sta);
void changeLanguage(QString lan);
void reFrash();
private:
Ui::ScreenShotTool *ui;
Canvas *screenCanvas;
QPixmap fullPixmap;
QSystemTrayIcon *m_systemTray; //系统托盘
QAction *setAction;
QAction *aboutAction;
QAction *exitAction;
void closeEvent( QCloseEvent * event ); //重写退出
bool closeFlag=false;
HotKeyBar *sc_set;
Qt::Key key;
Qt::KeyboardModifiers mods;
KeyString *keystring;
bool isAutoRun=false;
QxtGlobalShortcut *shortcut;
signals:
void appQuit();
private slots:
void slt_clickTray(QSystemTrayIcon::ActivationReason reason);
void slt_setAction();
void slt_aboutAction();
void slt_exitAction();
void slt_changeHotKey(Qt::Key t_key, Qt::KeyboardModifiers t_mod);
void slt_auto_run(int states);
void slt_language_set(int index);
void slt_doShot(void);
};
#endif // SCREENSHOTTOOL_H