-
Notifications
You must be signed in to change notification settings - Fork 18
/
corewindow.h
86 lines (58 loc) · 1.92 KB
/
corewindow.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
#ifndef COREWINDOW_H
#define COREWINDOW_H
#include <QMainWindow>
#include <QMessageBox>
#include <QStandardItem>
#include <QItemSelectionModel>
#include <QKeyEvent>
#include "otui/otui.h"
#include "events/setidevent.h"
#include "events/settingssavedevent.h"
#include "imagesourcebrowser.h"
#include "elidedlabel.h"
#include "projectsettings.h"
namespace Ui {
class MainWindow;
}
class CoreWindow : public QMainWindow
{
Q_OBJECT
public:
explicit CoreWindow(QWidget *parent = nullptr);
~CoreWindow();
static void ShowError(QString title, QString description);
void startNewProject(QString fileName, QString name, QString path, QString dataPath);
void loadProjectData(QDataStream &data, QString fileName, QString path);
private slots:
void on_newMainWindow_triggered();
void on_newButton_triggered();
void on_newLabel_triggered();
void on_actionDeleteWidget_triggered();
void on_treeView_customContextMenuRequested(const QPoint &pos);
void on_actionNewProject_triggered();
void on_actionSaveProject_triggered();
void on_actionCloseProject_triggered();
void on_horizontalSlider_valueChanged(int value);
void on_newUIItem_triggered();
void on_newUICreature_triggered();
void on_actionProject_Settings_triggered();
protected:
bool eventFilter(QObject *obj, QEvent *ev);
void keyReleaseEvent(QKeyEvent *event);
bool event(QEvent *event);
void closeEvent(QCloseEvent *event);
void resizeEvent(QResizeEvent *event);
private:
void initializeWindow();
void setProjectChanged(bool v);
private:
Ui::MainWindow *ui;
OTUI::Project *m_Project = nullptr;
QStandardItemModel *model = nullptr;
void addChildToTree(QString label);
void selectWidgetById(QString widgetId);
OTUI::Widget *m_selected = nullptr;
ImageSourceBrowser *imagesBrowser = nullptr;
ProjectSettings *m_projectSettings = nullptr;
};
#endif // COREWINDOW_H