-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmywindows.h
108 lines (96 loc) · 2.25 KB
/
mywindows.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#ifndef MYWINDOWS_H
#define MYWINDOWS_H
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <QCloseEvent>
#include <QColumnView>
#include <QDebug>
#include <QDesktopServices>
#include <QDir>
#include <QFileSystemModel>
#include <QGuiApplication>
#include <QHBoxLayout>
#include <QHeaderView>
#include <QInputDialog>
#include <QItemSelectionModel>
#include <QKeyEvent>
#include <QLabel>
#include <QMessageBox>
#include <QModelIndex>
#include <QModelIndexList>
#include <QPicture>
#include <QPixmap>
#include <QPushButton>
#include <QRect>
#include <QScreen>
#include <QSettings>
#include <QShortcut>
#include <QSizePolicy>
#include <QSpinBox>
#include <QStandardItemModel>
#include <QString>
#include <QTableView>
#include <QThreadPool>
#include <QUrl>
#include <QVBoxLayout>
#include <QWidget>
#include "deletetask.h"
#include "fileinfo.h"
#include "imagepreview.h"
#include "keypresseater.h"
class imagePreview;
class KeyPressEater;
class myWindows : public QWidget {
Q_OBJECT
public:
explicit myWindows(QWidget *parent = nullptr);
void keyPressEvent(QKeyEvent *event);
~myWindows();
QShortcut *shortcutSpace;
QShortcut *shortcutEnter;
QShortcut *shortcutDel;
QColumnView *columnView;
QFileSystemModel *model;
imagePreview *preview;
int screenH;
int screenW;
void closeEvent(QCloseEvent *);
int canDelete();
public slots:
void clickedNew(QModelIndex index, QModelIndex index2);
void keyboardEvent();
void keyboardEnter();
void keyboardDel();
void rename();
void keyReleaseEvent(QKeyEvent *event);
void depthChanged(int);
private:
void _rename(QString path, QString newName, int *num);
void loadSettings();
void saveSettings();
void updatePath(QModelIndex index);
void updateImage();
void updateImage(QString image);
bool parseFolderAndUpdate(QString path, int depth);
bool isImage(QString suffix);
int sizePreviewW;
int sizePreviewH;
int MAX_DEPTH = 2;
bool isShiftOn;
QList<QString> *toDelete;
QPixmap imDef;
QScreen *screen;
QVBoxLayout *layoutGlobal;
QHBoxLayout *layoutPreview;
QLabel *lab;
QLabel *deleteStatus;
fileInfo *info;
QString lastImagePath;
QString lastFilePath;
QString lastPath;
KeyPressEater *eater;
QStringList shiftList;
QSpinBox *spinBox;
};
#endif // MYWINDOWS_H