From 5c2783411ad4bcd2772b2dcbc0d38694af72e414 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 18 Nov 2009 20:32:12 +0100 Subject: Fixed key handling in the documentation index widget On Mac up/down arrow keys move the cursor to the beginning/end of the lineedit, however if the lineedit is used to control the indexwidget in assistant, we need to prevent it to get those events and move the text cursor. Reviewed-by: kh --- tools/assistant/tools/assistant/indexwindow.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/assistant/tools/assistant/indexwindow.cpp b/tools/assistant/tools/assistant/indexwindow.cpp index 6d35649..97828c1 100644 --- a/tools/assistant/tools/assistant/indexwindow.cpp +++ b/tools/assistant/tools/assistant/indexwindow.cpp @@ -112,18 +112,22 @@ bool IndexWindow::eventFilter(QObject *obj, QEvent *e) case Qt::Key_Up: idx = m_indexWidget->model()->index(idx.row()-1, idx.column(), idx.parent()); - if (idx.isValid()) + if (idx.isValid()) { m_indexWidget->setCurrentIndex(idx); + return true; + } break; case Qt::Key_Down: idx = m_indexWidget->model()->index(idx.row()+1, idx.column(), idx.parent()); - if (idx.isValid()) + if (idx.isValid()) { m_indexWidget->setCurrentIndex(idx); + return true; + } break; case Qt::Key_Escape: emit escapePressed(); - break; + return true; default: ; // stop complaining } } else if (obj == m_indexWidget && e->type() == QEvent::ContextMenu) { -- cgit v0.12