-----------------------------------------------------------------------------
| 225 | |
| 226 | //----------------------------------------------------------------------------- |
| 227 | void 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 | //----------------------------------------------------------------------------- |
| 253 | void pqPythonTabWidget::createNewEmptyTab() |
no test coverage detected