mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 17:49:27 +02:00
Make ScriptEngine a QObject instead of the derived class
Fix signal -- only needs to be in ScriptEngine
This commit is contained in:
parent
67e7a7375a
commit
8d6270392d
2 changed files with 3 additions and 9 deletions
|
@ -71,7 +71,8 @@ inline T scriptvalue_cast(const ScriptValue& value);
|
||||||
* To inject an exception into the running script, use raiseException(). This may result in the script
|
* To inject an exception into the running script, use raiseException(). This may result in the script
|
||||||
* not capturing it and an uncaughtException happening as a result.
|
* not capturing it and an uncaughtException happening as a result.
|
||||||
*/
|
*/
|
||||||
class ScriptEngine {
|
class ScriptEngine : public QObject {
|
||||||
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ScriptEngine(ScriptManager *manager = nullptr) : _manager(manager) {
|
ScriptEngine(ScriptManager *manager = nullptr) : _manager(manager) {
|
||||||
|
|
|
@ -57,7 +57,7 @@ const double GARBAGE_COLLECTION_TIME_LIMIT_S = 1.0;
|
||||||
Q_DECLARE_METATYPE(ScriptEngine::FunctionSignature)
|
Q_DECLARE_METATYPE(ScriptEngine::FunctionSignature)
|
||||||
|
|
||||||
/// [V8] Implements ScriptEngine for V8 and translates calls for QScriptEngine
|
/// [V8] Implements ScriptEngine for V8 and translates calls for QScriptEngine
|
||||||
class ScriptEngineV8 final : public QObject, public ScriptEngine,
|
class ScriptEngineV8 final : public ScriptEngine,
|
||||||
public std::enable_shared_from_this<ScriptEngineV8> {
|
public std::enable_shared_from_this<ScriptEngineV8> {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
@ -215,13 +215,6 @@ protected:
|
||||||
const ValueOwnership& ownership = AutoOwnership);*/
|
const ValueOwnership& ownership = AutoOwnership);*/
|
||||||
|
|
||||||
void registerSystemTypes();
|
void registerSystemTypes();
|
||||||
signals:
|
|
||||||
/**
|
|
||||||
* @brief The script being run threw an exception
|
|
||||||
*
|
|
||||||
* @param exception Exception that was thrown
|
|
||||||
*/
|
|
||||||
void exception(std::shared_ptr<ScriptException> exception);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static QMutex _v8InitMutex;
|
static QMutex _v8InitMutex;
|
||||||
|
|
Loading…
Reference in a new issue