forked from wolfwind521/IndoorMapEditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
93 lines (77 loc) · 2.09 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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QListIterator>
namespace Ui {
class MainWindow;
}
class DocumentView;
class PropertyView;
class Feature;
QT_FORWARD_DECLARE_CLASS(QTreeView)
QT_FORWARD_DECLARE_CLASS(QPrinter)
QT_FORWARD_DECLARE_CLASS(QCloseEvent)
QT_FORWARD_DECLARE_CLASS(QListWidgetItem)
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
DocumentView *currentDocument() const;
public slots:
void newFile();
void openFile();
void openRecentFile();
bool saveFile();
bool saveAsFile();
void autoSave();
void closeFile();
void exportFile();
void printFile();
void printCurrent();
void deleteFeature();
void onAddLayerButtonClicked();
void onDeleteButtonClicked();
void rebuildTreeView();
void updatePropertyView(Feature* mapFeature);
void setPolygonTool();
void setSelectTool();
void setPubPointTool();
void setMergeTool();
void setSplitTool();
void setScaleTool();
void setGraphicsViewFont();
void onFind();
void findAllRepeat();
void outputItemClicked(QListWidgetItem* item);
void sortAreas();
protected:
void closeEvent(QCloseEvent *event);
void dragEnterEvent(QDragEnterEvent *event);
void dropEvent(QDropEvent *event);
private:
bool okToContinue();
void addDocument(DocumentView* doc);
void openDocument(const QString & fileName);
bool saveDocument(const QString & fileName);
void setCurrentFile(const QString & fileName);
void readSettings();
void writeSettings();
void updateRecentFileActions();
Ui::MainWindow *ui;
QTreeView *m_sceneTreeView;
PropertyView *m_propertyView;
const int m_maxRecentFiles;
QStringList m_recentFiles;
std::vector<QAction*> m_recentFileActions;
QString m_curFile;
QString m_lastFilePath;
DocumentView* m_docView;
QPrinter *m_printer;
QTimer *m_timer;
int m_autoSaveTime;
QList<Feature *> m_searchResults;
QListIterator<Feature *> m_searchResultIter;
};
#endif // MAINWINDOW_H