MCPcopy Create free account
hub / github.com/TeXworks/texworks / createUI

Method createUI

src/scripting/ScriptAPI.cpp:184–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182}
183
184QWidget * 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
201QWidget * ScriptAPI::findChildWidget(QWidget* parent, const QString& name)
202{

Callers

nothing calls this directly

Calls 2

getFilenameMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected