| 324 | } |
| 325 | |
| 326 | bool 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 | |
| 353 | void QuickRefactorDialog::useLastInstructions() |
| 354 | { |