-
Notifications
You must be signed in to change notification settings - Fork 142
/
MainWindow.h
83 lines (67 loc) · 2.08 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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QListWidgetItem>
#include <QMainWindow>
#include <QSlider>
class LVGLSimulator;
class LVGLObject;
class LVGLProject;
class LVGLImageData;
class LVGLFontData;
QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE
class MainWindow : public QMainWindow {
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
LVGLSimulator *simulator() const;
private slots:
void updateProperty();
void setCurrentObject(LVGLObject *obj);
void styleChanged();
void loadRecent();
void openNewProject();
void on_action_load_triggered();
void on_action_save_triggered();
void on_combo_style_currentIndexChanged(int index);
void on_action_export_c_triggered();
void on_button_add_image_clicked();
void on_button_remove_image_clicked();
void on_list_images_customContextMenuRequested(const QPoint &pos);
void on_list_images_currentItemChanged(QListWidgetItem *current,
QListWidgetItem *previous);
void on_button_add_font_clicked();
void on_button_remove_font_clicked();
void on_list_fonts_customContextMenuRequested(const QPoint &pos);
void on_list_fonts_currentItemChanged(QListWidgetItem *current,
QListWidgetItem *previous);
void on_action_run_toggled(bool run);
void tabchanged(int index);
protected:
void showEvent(QShowEvent *event);
private:
void addImage(LVGLImageData *img, QString name);
void updateImages();
void addFont(LVGLFontData *font, QString name);
void updateFonts();
void updateRecentActionList();
void adjustForCurrentFile(const QString &fileName);
void loadProject(const QString &fileName);
void setEnableBuilder(bool enable);
Ui::MainWindow *m_ui;
QSlider *m_zoom_slider;
LVGLProject *m_project;
class LVGLPropertyModel *m_propertyModel;
class LVGLStyleModel *m_styleModel;
class LVGLObjectModel *m_objectModel;
QList<QAction *> m_recentFileActionList;
const int m_maxFileNr;
bool m_firstrun;
LVGLSimulator *m_simulator;
int m_lastindex;
};
#endif // MAINWINDOW_H