-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathImageDisplay.h
72 lines (58 loc) · 1.32 KB
/
ImageDisplay.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
#pragma once
#include <QWidget>
#include <QLabel>
#include <QScrollArea>
#include <QAction>
#include <QMessageBox>
#include <QVBoxLayout>
#include <QGroupBox>
#include <QLineEdit>
#include <QAction>
#include <QFileDialog>
#include <QCloseEvent>
class ImageDisplay : public QWidget
{
Q_OBJECT
public:
ImageDisplay( QWidget *parent = 0 , int maxCurrentHeight = 0, int maxCurrentWidth = 0);
void newFile();
void newFile(QString curFile);
bool open();
bool save();
bool saveAs();
QImage getImage();
QString getCurFile();
QString getCurFileWithStrippedName();
QAction *windowMenuAction() const
{
return action;
}
public slots:
void setImage( QImage image );
private slots:
void imageWasModified();
protected:
void closeEvent(QCloseEvent *event);
signals:
void imageChanged ( const QImage image );
private:
bool openFile(const QString &fileName);
bool readFile(const QString &fileName);
bool writeFile(const QString &fileName);
QString strippedName(const QString &fullFileName);
void setCurrentFile(const QString &fileName);
bool okToContinue();
QVBoxLayout *vLayout;
QGroupBox *groupBox;
QLabel *imageLabel;
QScrollArea *scrollArea;
QImage m_image;
double scaleFactor;
QString curFile;
bool isUntitled;
QString openFileFilters;
QString saveFileFilters;
QAction *action;
int maxCurHeight;
int maxCurWidth;
};