| 383 | } |
| 384 | |
| 385 | void StandardDocumentationView::keyReleaseEvent(QKeyEvent* event) |
| 386 | { |
| 387 | // Handle keyReleaseEvent instead of the usual keyPressEvent as a workaround |
| 388 | // for the conflicting reset font size Ctrl+0 shortcut added into KTextEditor |
| 389 | // in version 5.60. This new global shortcut prevents the Qt::Key_0 part of the |
| 390 | // shortcut from reaching KeyPress events, but it doesn't affect KeyRelease events. |
| 391 | // The end result is that Ctrl+0 always resets font size in the text editor |
| 392 | // because its shortcut is global. In addition, Ctrl+0 resets zoom factor in |
| 393 | // the current documentation provider if Documentation tool view has focus. |
| 394 | // Unfortunately there is no way to reset documentation zoom factor without |
| 395 | // simultaneously resetting font size in the text editor. |
| 396 | // An alternative workaround - creating one more Ctrl+0 shortcut - |
| 397 | // inevitably leads to conflicts with the KTextEditor's global shortcut. |
| 398 | Q_D(StandardDocumentationView); |
| 399 | |
| 400 | if (d->m_zoomController && d->m_zoomController->handleKeyPressEvent(event)) { |
| 401 | return; |
| 402 | } |
| 403 | QWidget::keyReleaseEvent(event); |
| 404 | } |
| 405 | |
| 406 | #include "standarddocumentationview.moc" |
| 407 | #include "moc_standarddocumentationview.cpp" |
nothing calls this directly
no test coverage detected