void startDialog::on_ScriptEdit_clicked() { EditorFrame *pMain = new EditorFrame(); pMain->setHostWidget(this); pMain->setAttribute(Qt::WA_DeleteOnClose, true); if (!loadDataBase()) { nd_logerror("load database error\n"); } std::string defProj = getPathFromConfig("script_root"); if (!defProj.empty() && pMain->myInit(defProj.c_str() )) { this->setVisible(false); pMain->showMaximized(); } else { delete pMain; } }
bool startDialog::showScriptError(const char *scriptFile, const char *nodeDescript, const char *editorWorkingPath) { nd_chdir(editorWorkingPath); EditorFrame *pMain = new EditorFrame(); pMain->setHostWidget(this); pMain->setAttribute(Qt::WA_DeleteOnClose, true); if (pMain->myInit()) { this->setVisible(false); if (!pMain->showRuntimeError(scriptFile, nodeDescript)) { return false; } pMain->showMaximized(); } else { delete pMain; return false; } return true; }