MCPcopy Create free account
hub / github.com/Kitware/ParaView / loadFile

Method loadFile

Qt/Python/pqPythonTabWidget.cxx:144–166  ·  view source on GitHub ↗

-----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

142
143//-----------------------------------------------------------------------------
144void pqPythonTabWidget::loadFile(const QString& fileName)
145{
146 // If the fileName is empty abort
147 if (fileName.isEmpty())
148 {
149 return;
150 }
151
152 QFile file(fileName);
153 if (!file.open(QFile::ReadOnly | QFile::Text))
154 {
155 QMessageBox::warning(pqCoreUtilities::mainWidget(), tr("Sorry!"),
156 tr("Cannot open file %1:\n%2.").arg(fileName).arg(file.errorString()));
157 return;
158 }
159
160 QTextStream in(&file);
161 const QString str = in.readAll();
162
163 // If not create a new tab
164 pqPythonTextArea* tArea = this->getCurrentTextArea();
165 tArea->setText(str);
166}
167
168//-----------------------------------------------------------------------------
169void pqPythonTabWidget::closeCurrentTab()

Callers 1

loadMethod · 0.80

Calls 6

getCurrentTextAreaMethod · 0.95
mainWidgetFunction · 0.85
trFunction · 0.85
isEmptyMethod · 0.45
openMethod · 0.45
setTextMethod · 0.45

Tested by

no test coverage detected