mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-24 12:34:39 +03:00
moveQObjectToScript() has been added to ScriptManager
This commit is contained in:
parent
6a18faf600
commit
f48e414114
@ -46,7 +46,9 @@ public:
|
|||||||
virtual bool addFunction(const QString &name, const QString& script,
|
virtual bool addFunction(const QString &name, const QString& script,
|
||||||
const QString &category="", const QString &description="") = 0;
|
const QString &category="", const QString &description="") = 0;
|
||||||
virtual const QString& lastError() const = 0;
|
virtual const QString& lastError() const = 0;
|
||||||
|
virtual ScriptValueType moveQObjectToScript(QObject* object, const QString objectName) = 0;
|
||||||
virtual ~IScriptEngineManager(){}
|
virtual ~IScriptEngineManager(){}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace LimeReport
|
} //namespace LimeReport
|
||||||
|
@ -562,6 +562,13 @@ void ScriptEngineManager::clearTableOfContents(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ScriptValueType ScriptEngineManager::moveQObjectToScript(QObject* object, const QString objectName)
|
||||||
|
{
|
||||||
|
ScriptValueType result = scriptEngine()->newQObject(object);
|
||||||
|
scriptEngine()->globalObject().setProperty(objectName, result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
void ScriptEngineManager::updateModel()
|
void ScriptEngineManager::updateModel()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -377,7 +377,7 @@ public:
|
|||||||
QVariant evaluateScript(const QString &script);
|
QVariant evaluateScript(const QString &script);
|
||||||
void addTableOfContentsItem(const QString& uniqKey, const QString& content, int indent);
|
void addTableOfContentsItem(const QString& uniqKey, const QString& content, int indent);
|
||||||
void clearTableOfContents();
|
void clearTableOfContents();
|
||||||
|
ScriptValueType moveQObjectToScript(QObject* object, const QString objectName);
|
||||||
protected:
|
protected:
|
||||||
void updateModel();
|
void updateModel();
|
||||||
bool containsFunction(const QString &functionName);
|
bool containsFunction(const QString &functionName);
|
||||||
|
@ -46,7 +46,9 @@ public:
|
|||||||
virtual bool addFunction(const QString &name, const QString& script,
|
virtual bool addFunction(const QString &name, const QString& script,
|
||||||
const QString &category="", const QString &description="") = 0;
|
const QString &category="", const QString &description="") = 0;
|
||||||
virtual const QString& lastError() const = 0;
|
virtual const QString& lastError() const = 0;
|
||||||
|
virtual ScriptValueType moveQObjectToScript(QObject* object, const QString objectName) = 0;
|
||||||
virtual ~IScriptEngineManager(){}
|
virtual ~IScriptEngineManager(){}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace LimeReport
|
} //namespace LimeReport
|
||||||
|
Loading…
Reference in New Issue
Block a user