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

Method setTabCloseButton

Qt/Python/pqPythonTabWidget.cxx:283–299  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

281
282//-----------------------------------------------------------------------------
283void pqPythonTabWidget::setTabCloseButton(pqPythonTextArea* widget)
284{
285 QPixmap closePixmap = this->style()->standardIcon(QStyle::SP_TitleBarCloseButton).pixmap(16, 16);
286 QString label = tr("Close Tab");
287 pqClickableLabel* cLabel =
288 new pqClickableLabel(widget, label, label, label, &closePixmap, widget);
289 this->tabBar()->setTabButton(this->count() - 2, QTabBar::RightSide, cLabel);
290 this->connect(cLabel, &pqClickableLabel::onClicked,
291 [this](QWidget* clickedWidget)
292 {
293 int idx = this->indexOf(clickedWidget);
294 if (idx >= 0 && idx < this->count() - 1)
295 {
296 Q_EMIT this->tabCloseRequested(idx);
297 }
298 });
299}
300
301//-----------------------------------------------------------------------------
302void pqPythonTabWidget::addNewTabWidget()

Callers 1

createNewEmptyTabMethod · 0.95

Calls 6

trFunction · 0.85
setTabButtonMethod · 0.80
pixmapMethod · 0.45
countMethod · 0.45
connectMethod · 0.45
indexOfMethod · 0.45

Tested by

no test coverage detected