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

Method updateTab

Qt/Python/pqPythonTabWidget.cxx:227–250  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

225
226//-----------------------------------------------------------------------------
227void pqPythonTabWidget::updateTab(QWidget* widget)
228{
229 const int idx = this->indexOf(widget);
230 if (idx != -1)
231 {
232 QString tabName;
233 QString elidedTabName;
234 QString unstyledTabName;
235 this->generateTabName(
236 qobject_cast<pqPythonTextArea*>(widget), tabName, elidedTabName, unstyledTabName);
237 pqClickableLabel* cLabel =
238 new pqClickableLabel(widget, elidedTabName, tabName, unstyledTabName, nullptr, widget);
239 this->tabBar()->setTabButton(idx, QTabBar::LeftSide, cLabel);
240 this->connect(cLabel, &pqClickableLabel::onClicked,
241 [this](QWidget* clickedWidget)
242 {
243 int tmpIdx = this->indexOf(clickedWidget);
244 if (tmpIdx >= 0 && tmpIdx < this->count() - 1)
245 {
246 this->setCurrentIndex(tmpIdx);
247 }
248 });
249 }
250}
251
252//-----------------------------------------------------------------------------
253void pqPythonTabWidget::createNewEmptyTab()

Callers 2

createNewEmptyTabMethod · 0.95
stopTraceMethod · 0.95

Calls 6

generateTabNameMethod · 0.95
setTabButtonMethod · 0.80
indexOfMethod · 0.45
connectMethod · 0.45
countMethod · 0.45
setCurrentIndexMethod · 0.45

Tested by

no test coverage detected