mirror of
				https://github.com/python-LimeReport/LimeReport.git
				synced 2025-10-31 05:42:03 +03:00 
			
		
		
		
	Dialogs for QJSEngine has been fixed. Child objects registration has been added
This commit is contained in:
		| @@ -293,11 +293,24 @@ void ReportRender::initVariables() | ||||
| } | ||||
|  | ||||
| #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(){ | ||||
|     if (m_scriptEngineContext){ | ||||
|         ScriptEngineType* se = ScriptEngineManager::instance().scriptEngine(); | ||||
|         foreach(DialogDescriber::Ptr dialog, m_scriptEngineContext->dialogsDescriber()){ | ||||
|             ScriptValueType sv = se->newQObject(m_scriptEngineContext->getDialog(dialog->name())); | ||||
| #ifdef USE_QJSENGINE | ||||
|             registerChildObjects(se,&sv); | ||||
| #endif | ||||
|             se->globalObject().setProperty(dialog->name(),sv); | ||||
|         } | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user