| 182 | } |
| 183 | |
| 184 | QWidget * ScriptAPI::createUI(const QString& filename, QWidget * parent) |
| 185 | { |
| 186 | QFileInfo fi(QFileInfo(m_script->getFilename()).absoluteDir(), filename); |
| 187 | if (!fi.isReadable()) |
| 188 | return nullptr; |
| 189 | QFile file(fi.canonicalFilePath()); |
| 190 | QUiLoader loader; |
| 191 | QWidget *widget = loader.load(&file, parent); |
| 192 | if (widget) { |
| 193 | // ensure that the window is app-modal regardless of what flags might be set |
| 194 | //! \TODO revisit this when we get asynchronous scripting |
| 195 | widget->setWindowModality(Qt::ApplicationModal); |
| 196 | widget->show(); |
| 197 | } |
| 198 | return widget; |
| 199 | } |
| 200 | |
| 201 | QWidget * ScriptAPI::findChildWidget(QWidget* parent, const QString& name) |
| 202 | { |
nothing calls this directly
no test coverage detected