-----------------------------------------------------------------------------
| 173 | |
| 174 | //----------------------------------------------------------------------------- |
| 175 | void pqPythonTabWidget::keyPressEvent(QKeyEvent* keyEvent) |
| 176 | { |
| 177 | if (keyEvent->matches(QKeySequence::AddTab)) |
| 178 | { |
| 179 | this->createNewEmptyTab(); |
| 180 | keyEvent->accept(); |
| 181 | } |
| 182 | else if (keyEvent->matches(QKeySequence::NextChild)) |
| 183 | { |
| 184 | const int nextTabId = (this->currentIndex() + 1) % (this->count() - 1); |
| 185 | this->setCurrentIndex(nextTabId); |
| 186 | } |
| 187 | else if (keyEvent->matches(QKeySequence::PreviousChild)) |
| 188 | { |
| 189 | const int nextTabId = (this->currentIndex() + this->count() - 2) % (this->count() - 1); |
| 190 | this->setCurrentIndex(nextTabId); |
| 191 | } |
| 192 | |
| 193 | keyEvent->ignore(); |
| 194 | } |
| 195 | |
| 196 | void pqPythonTabWidget::mousePressEvent(QMouseEvent* mouseEvent) |
| 197 | { |
nothing calls this directly
no test coverage detected