summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews/qitemdelegate.cpp
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2009-07-17 08:31:29 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2009-07-17 08:31:29 (GMT)
commit2eff119b029ca51b6251d29681ca95200ed3e855 (patch)
tree065e98baad39d3431e88430784ef691aea7067a9 /src/gui/itemviews/qitemdelegate.cpp
parent58f79fd4375d4ac3630c9fa6577d5f053b052abd (diff)
parent6664324b12a3339d18251df1cd69a1da06d1e2dc (diff)
downloadQt-2eff119b029ca51b6251d29681ca95200ed3e855.zip
Qt-2eff119b029ca51b6251d29681ca95200ed3e855.tar.gz
Qt-2eff119b029ca51b6251d29681ca95200ed3e855.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/gui/itemviews/qitemdelegate.cpp')
-rw-r--r--src/gui/itemviews/qitemdelegate.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/gui/itemviews/qitemdelegate.cpp b/src/gui/itemviews/qitemdelegate.cpp
index 2dd5540..a285113 100644
--- a/src/gui/itemviews/qitemdelegate.cpp
+++ b/src/gui/itemviews/qitemdelegate.cpp
@@ -1219,15 +1219,12 @@ bool QItemDelegate::eventFilter(QObject *object, QEvent *event)
if (editor->parentWidget())
editor->parentWidget()->setFocus();
return true;
- } else if (event->type() == QEvent::FocusOut || event->type() == QEvent::Hide) {
+ } else if (event->type() == QEvent::FocusOut || (event->type() == QEvent::Hide && editor->isWindow())) {
//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.