-
Notifications
You must be signed in to change notification settings - Fork 1
/
ChildWidget.h
91 lines (73 loc) · 2.04 KB
/
ChildWidget.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
/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <mk219533 (a) students.mimuw.edu.pl> wrote this file. As long as you retain
* this notice you can do whatever you want with this stuff. If we meet some day,
* and you think this stuff is worth it, you can buy me a beer in return.
* ----------------------------------------------------------------------------
*
* ChildWidget.h
*
* Created on: 2010-01-06
* Author: Marcel Kolodziejczyk
*/
#ifndef CHILDWIDGET_H_
#define CHILDWIDGET_H_
#include <QSplitter>
class QGraphicsScene;
class QGraphicsView;
class QAbstractItemModel;
class QItemSelectionModel;
class QTableView;
class QGraphicsItem;
class QGraphicsRectItem;
class ChildWidget : public QSplitter
{
Q_OBJECT
public:
ChildWidget(QWidget * parent = 0);
bool isModified() { return modified; }
bool isBoxSelected();
bool isBold();
bool isItalic();
bool isUnderLine();
QString userFriendlyCurrentFile();
QString canonicalImageFileName() { return imageFile; }
bool save();
bool loadImage(const QString &fileName);
bool loadBoxes(const QString &fileName);
void setBolded(bool v);
void setItalic(bool v);
void setUnderline(bool v);
void zoomIn();
void zoomOut();
void splitSymbol();
void joinSymbol();
void deleteSymbol();
private slots:
void documentWasModified();
void emitBoxChanged();
void drawSelectionRects();
protected:
void closeEvent(QCloseEvent *event);
bool maybeSave();
void setCurrentImageFile(const QString &fileName);
void setCurrentBoxFile(const QString &fileName);
QString strippedName(const QString &fullFileName);
signals:
void boxChanged();
void modifiedChanged();
protected:
QGraphicsScene *imageScene;
QGraphicsView *imageView;
QGraphicsItem * imageItem;
QGraphicsRectItem *imageSelectionRect;
QTableView *table;
QAbstractItemModel *model;
QItemSelectionModel *selectionModel;
QString imageFile;
QString boxFile;
bool modified;
int imageHeight;
};
#endif /* CHILDWIDGET_H_ */