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

Method createNewEmptyTab

Qt/Python/pqPythonTabWidget.cxx:253–280  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

251
252//-----------------------------------------------------------------------------
253void pqPythonTabWidget::createNewEmptyTab()
254{
255 pqPythonTextArea* widget = new pqPythonTextArea(this);
256
257 this->insertTab(this->count() - 1, widget, "");
258 this->setCurrentIndex(this->indexOf(widget));
259 this->lastFocus = widget;
260
261 this->updateTab(widget);
262
263 this->connect(widget, &pqPythonTextArea::fileOpened,
264 [this, widget](const QString&) { this->updateTab(widget); });
265
266 this->connect(widget, &pqPythonTextArea::fileSaved,
267 [this, widget](const QString&) { this->updateTab(widget); });
268
269#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
270 QObject::connect(QApplication::styleHints(), &QStyleHints::colorSchemeChanged, this,
271 [this, widget](Qt::ColorScheme) { this->updateTab(widget); });
272#endif
273
274 this->connect(
275 widget, &pqPythonTextArea::contentChanged, [this, widget]() { this->updateTab(widget); });
276
277 this->connect(widget, &pqPythonTextArea::fileOpened, this, &pqPythonTabWidget::fileOpened);
278 this->connect(widget, &pqPythonTextArea::fileSaved, this, &pqPythonTabWidget::fileSaved);
279 this->setTabCloseButton(widget);
280}
281
282//-----------------------------------------------------------------------------
283void pqPythonTabWidget::setTabCloseButton(pqPythonTextArea* widget)

Callers 5

pqPythonTabWidgetMethod · 0.95
addNewTextAreaMethod · 0.95
keyPressEventMethod · 0.95
addNewTabWidgetMethod · 0.95

Calls 6

updateTabMethod · 0.95
setTabCloseButtonMethod · 0.95
countMethod · 0.45
setCurrentIndexMethod · 0.45
indexOfMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected