diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-05-05 15:03:09 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-05-05 18:22:40 (GMT) |
commit | 5443871a89e01c8d8a8440f7786a24ea87922106 (patch) | |
tree | 90d06a6bbb1ce57e77b3cbc134006e199baba68d /src/gui/itemviews/qabstractitemview.cpp | |
parent | 98d485b54d2da97b83b7ff2379b31039923f922e (diff) | |
download | Qt-5443871a89e01c8d8a8440f7786a24ea87922106.zip Qt-5443871a89e01c8d8a8440f7786a24ea87922106.tar.gz Qt-5443871a89e01c8d8a8440f7786a24ea87922106.tar.bz2 |
Accept the event when doing keyboard search on a itemview.
This is required for KHTML
Patch by David Faure
(the test is not really related)
Reviewed-by: Thierry
Task-number: 252912
Diffstat (limited to 'src/gui/itemviews/qabstractitemview.cpp')
-rw-r--r-- | src/gui/itemviews/qabstractitemview.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 4e4392f..4c1f7fc 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -2165,11 +2165,12 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event) } #endif bool modified = (event->modifiers() & (Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier)); - if (!event->text().isEmpty() && !modified) { - if (!edit(currentIndex(), AnyKeyPressed, event)) - keyboardSearch(event->text()); + if (!event->text().isEmpty() && !modified && !edit(currentIndex(), AnyKeyPressed, event)) { + keyboardSearch(event->text()); + event->accept(); + } else { + event->ignore(); } - event->ignore(); break; } } } |