-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathluascriptcontroller.h
More file actions
55 lines (40 loc) · 1.59 KB
/
luascriptcontroller.h
File metadata and controls
55 lines (40 loc) · 1.59 KB
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
#ifndef LUASCRIPTCONTROLLER_H
#define LUASCRIPTCONTROLLER_H
#include <QObject>
#include <QSharedPointer>
#include <QQmlComponent>
#include <QQmlApplicationEngine>
#include <QQuickItem>
#include <QList>
#include "luascriptqmladapter.h"
#include "model/luaeditormodel.h"
#include "qml/luaeditorqml.h"
class LuaScriptAdapter;
class LuaEditorModelItem;
class LuaScriptController : public QObject
{
Q_OBJECT
public:
explicit LuaScriptController(QQmlApplicationEngine* qmlEngine, QSharedPointer<LuaScriptAdapter> ptrLuaScriptAdapter, QObject* parent = Q_NULLPTR);
virtual ~LuaScriptController();
public slots:
void slot_createLuaScript(const QString& filePathName);
void slot_removeLuaScript(int index);
void slot_saveLuaScript(const QString& filePathName, const QString& content);
void slot_luaScriptSaved();
void slot_sendLuaScriptError(const QString& filePathName, const QString& errorMessage, int line, int start, int end);
void prepareLuaApi(const QString& filePathName, bool parseSilent);
private:
LuaEditorQml* createNewLuaEditorQml(void);
// Function to recursively search for a child item by name
QQuickItem* findChildRecursive(QObject* parent, const QString& childName);
private:
QQmlApplicationEngine* qmlEngine;
LuaScriptQmlAdapter* luaScriptQmlAdapter;
LuaEditorModel* luaEditorModel;
QSharedPointer<LuaScriptAdapter> ptrLuaScriptAdapter;
QQmlComponent* luaScriptQmlComponent;
QQuickItem* luaEditorContainer;
QList<LuaEditorQml*> luaEditorQmls;
};
#endif // LUASCRIPTCONTROLLER_H