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

Method eventFilter

Qt/Python/pqPythonTextArea.cxx:84–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82#define TEST_SEQUENCE(EVENT, MODIFIER, KEY) \
83 ((EVENT)->modifiers() & (MODIFIER)) && (EVENT)->key() == (KEY)
84bool pqPythonTextArea::eventFilter(QObject* obj, QEvent* event)
85{
86 if (event->type() == QEvent::KeyPress)
87 {
88 QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
89 if (keyEvent->matches(QKeySequence::Undo))
90 {
91 this->UndoStack.undo();
92 this->LineNumberArea->update();
93 return true;
94 }
95 else if (keyEvent->matches(QKeySequence::Redo))
96 {
97 this->UndoStack.redo();
98 this->LineNumberArea->update();
99 return true;
100 }
101 }
102
103 return QObject::eventFilter(obj, event);
104}
105#undef TEST_SEQUENCE
106
107//-----------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 4

typeMethod · 0.45
undoMethod · 0.45
updateMethod · 0.45
redoMethod · 0.45

Tested by

no test coverage detected