diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-11-18 19:32:12 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-11-25 17:01:11 (GMT) |
commit | 5c2783411ad4bcd2772b2dcbc0d38694af72e414 (patch) | |
tree | 26a8130cb20aa7820e152e7cd2c2b58d5c49d921 | |
parent | aaae24808654d54bf8aca04f825c6aa786fe342f (diff) | |
download | Qt-5c2783411ad4bcd2772b2dcbc0d38694af72e414.zip Qt-5c2783411ad4bcd2772b2dcbc0d38694af72e414.tar.gz Qt-5c2783411ad4bcd2772b2dcbc0d38694af72e414.tar.bz2 |
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
-rw-r--r-- | tools/assistant/tools/assistant/indexwindow.cpp | 10 |
1 files 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) { |