-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathluascriptqmladapter.cpp
More file actions
69 lines (54 loc) · 1.92 KB
/
luascriptqmladapter.cpp
File metadata and controls
69 lines (54 loc) · 1.92 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include "luascriptqmladapter.h"
LuaScriptQmlAdapter* LuaScriptQmlAdapter::ms_pInstance = Q_NULLPTR;
QMutex LuaScriptQmlAdapter::ms_mutex;
LuaScriptQmlAdapter::LuaScriptQmlAdapter(QObject* parent)
: QObject{parent}
{
}
LuaScriptQmlAdapter* LuaScriptQmlAdapter::instance()
{
QMutexLocker lock(&ms_mutex);
if (ms_pInstance == Q_NULLPTR)
{
ms_pInstance = new LuaScriptQmlAdapter();
}
return ms_pInstance;
}
QObject* LuaScriptQmlAdapter::getSingletonTypeProvider(QQmlEngine* pEngine, QJSEngine* pScriptEngine)
{
Q_UNUSED(pEngine)
Q_UNUSED(pScriptEngine)
return instance();
}
void LuaScriptQmlAdapter::changeTab(int newTabIndex)
{
Q_EMIT signal_changeTab(newTabIndex);
}
void LuaScriptQmlAdapter::requestSetLuaApi(const QString& filePathName, bool parseSilent)
{
Q_EMIT signal_requestSetLuaApi(filePathName, parseSilent);
}
void LuaScriptQmlAdapter::relayKeyPress(int key)
{
Q_EMIT signal_relayKeyPress(key);
}
void LuaScriptQmlAdapter::checkSyntax(const QString& filePathName, const QString& luaCode)
{
Q_EMIT signal_requestSyntaxCheck(filePathName, luaCode);
}
void LuaScriptQmlAdapter::syntaxCheckResult(const QString& filePathName, bool valid, int line, int start, int end, const QString& message)
{
Q_EMIT signal_syntaxCheckResult(filePathName, valid, line, start, end, message);
}
void LuaScriptQmlAdapter::runtimeErrorResult(const QString& filePathName, bool valid, int line, int start, int end, const QString &message)
{
Q_EMIT signal_runtimeErrorResult(filePathName, valid, line, start, end, message);
}
void LuaScriptQmlAdapter::luaApiPreparationResult(bool parseSilent, bool success, const QString& message)
{
Q_EMIT signal_luaApiPreparationResult(parseSilent, success, message);
}
void LuaScriptQmlAdapter::resultSearchMatchCount(int matchCount)
{
Q_EMIT signal_resultSearchMatchCount(matchCount);
}