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

Method addNewTextArea

Qt/Python/pqPythonTabWidget.cxx:117–141  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

115
116//-----------------------------------------------------------------------------
117void pqPythonTabWidget::addNewTextArea(const QString& fileName, vtkTypeUInt32 location)
118{
119 // If the fileName is empty abort
120 if (fileName.isEmpty())
121 {
122 return;
123 }
124
125 const int isOpened = this->fileIsOpened(fileName);
126 if (isOpened != -1)
127 {
128 this->setCurrentIndex(isOpened);
129 return;
130 }
131
132 pqPythonTextArea* tArea = this->getCurrentTextArea();
133 if (!tArea->isEmpty() || tArea->isLinked())
134 {
135 this->createNewEmptyTab();
136 tArea = this->getCurrentTextArea();
137 }
138
139 // If not create a new tab
140 tArea->openFile(fileName, location);
141}
142
143//-----------------------------------------------------------------------------
144void pqPythonTabWidget::loadFile(const QString& fileName)

Callers 2

openMethod · 0.80

Calls 6

fileIsOpenedMethod · 0.95
getCurrentTextAreaMethod · 0.95
createNewEmptyTabMethod · 0.95
isEmptyMethod · 0.45
setCurrentIndexMethod · 0.45
openFileMethod · 0.45

Tested by

no test coverage detected