-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmainwindow.h
More file actions
76 lines (57 loc) · 1.39 KB
/
Copy pathmainwindow.h
File metadata and controls
76 lines (57 loc) · 1.39 KB
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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QString>
#include <QDir>
#include <QFileInfoList>
#include <QLabel>
#include <QFileSystemModel>
#include <QModelIndex>
#include <QPixmap>
#include <QRect>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
void showImg();
int getIndex(QString string);
protected:
void resizeEvent(QResizeEvent * event);
//槽
private slots:
//关闭窗口
void on_closeWin_action_triggered();
//打开图片
void on_open_action_triggered();
//文件改变
void fileChanged(const QModelIndex &index);
//关闭图片
void on_closePic_action_triggered();
//放大
void on_zoomin_triggered();
//缩小
void on_zoomout_triggered();
//上一张
void on_up_triggered();
//下一张
void on_down_triggered();
//还原
void on_restore_triggered();
private:
Ui::MainWindow *ui;
int i; //用来判断第几张
QString curPath; //当前路径
QString curFileName; //当前文件名
QDir curDir; //当前文件夹
QFileInfoList fileInfoList; //图像列表
QFileSystemModel *model; //给listview使用的过滤器
QPixmap pix; //图像
double level;//放大系数
QRect screenRect; //屏幕尺寸
};
#endif // MAINWINDOW_H