-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
179 lines (149 loc) · 3.56 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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QGraphicsScene>
#include <QString>
#include <QDirIterator>
#include <QImage>
#include <QImageReader>
#include <QMessageBox>
#include <QDebug>
#include <QKeyEvent>
#include <QFile>
#include <QWheelEvent>
#include <QSettings>
#include <QDateTime>
#include <QLabel>
#include <QtMultimedia>
#include <QMediaMetaData>
#include <bits/stdc++.h>
#include "message.h"
#include "preferences.h"
extern int position;
extern int maxImages;
extern int ssDelay;
//extern bool direction;
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
QString fileName;
// QString getFileName() {
// return fileName;
// }
QSize getOldSize() {
return oldSize;
}
// QSize getNewSize(){
// QSize newSize(nw,nh);
// return newSize;
// }
bool setDirPath (QString thePath) {
dirPath = thePath;
return (QDir(dirPath).exists());
}
QString getDirPath()
{
return dirPath;
}
void setMax(QSize size) {
maxh = size.height();
maxw = size.width();
}
QPixmap getNextImage(QString thePath) {
fileName = thePath;
//qDebug() << "Position =" << position << ". thePosition =" << thePosition << ". MaxImages = " << maxImages << ". Filename =" << fileName;
QPixmap loadedImage;
loadedImage.load(fileName);
QSize sizeOfImage = loadedImage.size();
nh = sizeOfImage.height(); // - 40;
nw = sizeOfImage.width(); // - 40;
oldSize.setWidth(sizeOfImage.width());
oldSize.setHeight(sizeOfImage.height());
return (loadedImage);
}
bool release;
int searchMax;
int oldPosition;
QTimer *timer;
QString searchExpression;
QString searchTerm;
protected:
// void mouseReleaseEvent( QMouseEvent * event );
bool eventFilter(QObject *obj, QEvent *event) override;
void keyPressEvent(QKeyEvent* event);
void wheelEvent(QWheelEvent *event);
void displayIt();
void setDirectory(QString rPath);
bool deleteFile();
void actDelete();
void actNext();
void actPrev();
void actSearch();
void actSkip();
void actSkipBack();
void actFullScreen();
void actSlideShow();
void actOpen();
void actPreferences();
void sortFiles(int orderBy);
void sortFiles();
void searchPicture();
void exitApp();
void actSetPref();
QString selectPath();
void resizeEvent(QResizeEvent *event);
private slots:
void on_label_linkActivated(); //const QString &link);
void on_timerOut();
private:
void createActions();
void createMenus();
QMenu *fileMenu;
QMenu *editMenu;
QMenu *viewMenu;
QMenu *aboutMenu;
QAction *openAct;
QAction *searchAct;
QAction *deleteAct;
QAction *nextAct;
QAction *prevAct;
QAction *exitAct;
QAction *skipAct;
QAction *skipBackAct;
QAction *slideShowAct;
QAction *fullScreenAct;
QAction *preferencesAct;
Ui::MainWindow *ui;
QGraphicsScene *scene;
QPixmap image;
QString dirPath;
QSize oldSize;
float nw;
float nh;
float maxw;
float maxh;
message *myMessage;
Preferences prefs;
signals:
void clicked();
void textChanged();
// void finished();
};
class dirItems {
public:
QString thePath;
QString fileName;
int theNumber;
int imgSize;
int width;
int height;
QDateTime cdate;
private:
};
#endif // MAINWINDOW_H