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

Method keyPressEvent

Qt/Python/pqPythonTabWidget.cxx:175–194  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

173
174//-----------------------------------------------------------------------------
175void 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
196void pqPythonTabWidget::mousePressEvent(QMouseEvent* mouseEvent)
197{

Callers

nothing calls this directly

Calls 5

createNewEmptyTabMethod · 0.95
acceptMethod · 0.45
currentIndexMethod · 0.45
countMethod · 0.45
setCurrentIndexMethod · 0.45

Tested by

no test coverage detected