mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-24 12:34:39 +03:00
Dialogs for QJSEngine has been fixed. Child objects registration has been added
This commit is contained in:
parent
cf1b2a4146
commit
97c1eb3f77
@ -293,11 +293,24 @@ void ReportRender::initVariables()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_UI_LOADER
|
#ifdef HAVE_UI_LOADER
|
||||||
|
|
||||||
|
#ifdef USE_QJSENGINE
|
||||||
|
void registerChildObjects(ScriptEngineType* se, ScriptValueType* sv){
|
||||||
|
foreach(QObject* obj, sv->toQObject()->children()){
|
||||||
|
ScriptValueType child = se->newQObject(obj);
|
||||||
|
sv->setProperty(obj->objectName(),child);
|
||||||
|
registerChildObjects(se, &child);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
void ReportRender::initDialogs(){
|
void ReportRender::initDialogs(){
|
||||||
if (m_scriptEngineContext){
|
if (m_scriptEngineContext){
|
||||||
ScriptEngineType* se = ScriptEngineManager::instance().scriptEngine();
|
ScriptEngineType* se = ScriptEngineManager::instance().scriptEngine();
|
||||||
foreach(DialogDescriber::Ptr dialog, m_scriptEngineContext->dialogsDescriber()){
|
foreach(DialogDescriber::Ptr dialog, m_scriptEngineContext->dialogsDescriber()){
|
||||||
ScriptValueType sv = se->newQObject(m_scriptEngineContext->getDialog(dialog->name()));
|
ScriptValueType sv = se->newQObject(m_scriptEngineContext->getDialog(dialog->name()));
|
||||||
|
#ifdef USE_QJSENGINE
|
||||||
|
registerChildObjects(se,&sv);
|
||||||
|
#endif
|
||||||
se->globalObject().setProperty(dialog->name(),sv);
|
se->globalObject().setProperty(dialog->name(),sv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user