-
Notifications
You must be signed in to change notification settings - Fork 1
/
MainWindow.h
51 lines (43 loc) · 1.07 KB
/
MainWindow.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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "photo/photoitem.h"
#include "photoview.h"
#include "photoscene.h"
#ifdef Q_OS_WINDOWS
#include <windows.h>
#include <QtWinExtras/QtWin>
#include <QDomComment>
#endif
#include <QAbstractNativeEventFilter>
#include <QLabel>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow, public QAbstractNativeEventFilter
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
/**
* @brief CreateItem 生成一个Item
* @param path 图片完整路径
*/
void CreateItem(const QString& path);
/**
* @brief CreateItem 生成一个Item
* @param pixmap 已有图片
*/
void CreateItem(const QPixmap& pixmap);
protected:
virtual bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override;
void Init();
void Capture();
private:
Ui::MainWindow *ui;
PhotoView* m_pView;
PhotoScene* m_pScene;
QLabel* m_pLabelPrompt;
};
#endif // MAINWINDOW_H