MCPcopy Create free account
hub / github.com/Palm1r/QodeAssist / eventFilter

Method eventFilter

widgets/QuickRefactorDialog.cpp:326–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324}
325
326bool QuickRefactorDialog::eventFilter(QObject *watched, QEvent *event)
327{
328 if (event->type() == QEvent::KeyPress) {
329 QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
330
331 if (watched == m_instructionEdit) {
332 if (keyEvent->key() == Qt::Key_Tab) {
333 m_commandsComboBox->setFocus();
334 return true;
335 }
336 }
337
338 if (watched == m_commandsComboBox || watched == m_commandsComboBox->lineEdit()) {
339 if (keyEvent->key() == Qt::Key_Tab) {
340 QPushButton *okButton = findChild<QPushButton *>();
341 if (okButton && okButton->text() == "OK") {
342 okButton->setFocus();
343 } else {
344 focusNextChild();
345 }
346 return true;
347 }
348 }
349 }
350 return QDialog::eventFilter(watched, event);
351}
352
353void QuickRefactorDialog::useLastInstructions()
354{

Callers

nothing calls this directly

Calls 3

setFocusMethod · 0.80
typeMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected