-----------------------------------------------------------------------------
| 281 | |
| 282 | //----------------------------------------------------------------------------- |
| 283 | void 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 | //----------------------------------------------------------------------------- |
| 302 | void pqPythonTabWidget::addNewTabWidget() |
no test coverage detected