-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomicreader.h
82 lines (70 loc) · 1.8 KB
/
comicreader.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
#ifndef COMICREADER_H
#define COMICREADER_H
#include <QMainWindow>
#include <QVector>
#include <QLabel>
#include <QScrollBar>
#include <QScrollArea>
#include <QComboBox>
#include <QThread>
#include "page.h"
#include "pageloader.h"
namespace Ui {
class ComicReader;
}
class ComicReader : public QMainWindow
{
Q_OBJECT
public:
explicit ComicReader(QWidget *parent = 0);
~ComicReader();
QVector<Page> pageVector; // The vector of loaded pages
signals:
void preparePages(const QString& path); // signal to start loading pages without images
void loadImages(int pageNumber); // signal to load images for this page and its neighbour pages
public slots:
void loadPages();
private:
Ui::ComicReader *ui;
// Actions
void createActions();
void updateActions();
// Images
void setPage();
void zoomIn();
void zoomOut();
void scaleImage(double factor);
void adjustScrollBar(QScrollBar *scrollBar, double factor);
void freePageVector();
// Control
void open();
void prevPage();
void nextPage();
void normalSize();
void fitToWindow();
void triggerDoublePage();
void scaleImageToWindow();
bool isFirstPage;
QVector<Page>::Iterator pageIterator;
QPixmap currentPixmap;
QLabel* centerLabel;
QScrollArea* centerScrollArea;
QComboBox pageComboBox; // comboBox to show page number
double scaleFactor;
// QAction
QAction* openAct;
QAction* prevAct;
QAction* nextAct;
QAction* zoomInAct;
QAction* zoomOutAct;
QAction* normalSizeAct;
QAction* fitToWindowAct;
QAction* doublePageAct;
QString filePath;
QThread loadPagesThread;
PageLoader pageLoader;
protected:
virtual void resizeEvent(QResizeEvent *event);
virtual QSize sizeHint() const;
};
#endif // COMICREADER_H