diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-07-16 14:54:08 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-07-16 14:57:00 (GMT) |
commit | 95560abfdd3a1755b69f238eff2954d164dff6a5 (patch) | |
tree | 042fcd0c2db6885232d7016c36d9b37838541f45 /src/gui/itemviews/qitemdelegate.cpp | |
parent | ccb7c66e08b1bc4f31a66221cd4e4f8f61a5e462 (diff) | |
download | Qt-95560abfdd3a1755b69f238eff2954d164dff6a5.zip Qt-95560abfdd3a1755b69f238eff2954d164dff6a5.tar.gz Qt-95560abfdd3a1755b69f238eff2954d164dff6a5.tar.bz2 |
Small simplification of code in ItemViews (delegate)
Diffstat (limited to 'src/gui/itemviews/qitemdelegate.cpp')
-rw-r--r-- | src/gui/itemviews/qitemdelegate.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gui/itemviews/qitemdelegate.cpp b/src/gui/itemviews/qitemdelegate.cpp index 2dd5540..7d0f7c6 100644 --- a/src/gui/itemviews/qitemdelegate.cpp +++ b/src/gui/itemviews/qitemdelegate.cpp @@ -1222,12 +1222,9 @@ bool QItemDelegate::eventFilter(QObject *object, QEvent *event) } else if (event->type() == QEvent::FocusOut || event->type() == QEvent::Hide) { //the Hide event will take care of he editors that are in fact complete dialogs if (!editor->isActiveWindow() || (QApplication::focusWidget() != editor)) { - QWidget *w = QApplication::focusWidget(); - while (w) { // don't worry about focus changes internally in the editor - if (w == editor) - return false; - w = w->parentWidget(); - } + if (editor->isAncestorOf(QApplication::focusWidget())) + return false; // don't worry about focus changes internally in the editor + #ifndef QT_NO_DRAGANDDROP // The window may lose focus during an drag operation. // i.e when dragging involves the taskbar on Windows. |