diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-07-16 14:56:08 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-07-16 14:57:01 (GMT) |
commit | ca2122e9eb2b0d68d4203b05128f6fc5a838f3d6 (patch) | |
tree | 6d402b6b3970e8c3adc3e0f2a0e0bfed035311c5 /src/gui | |
parent | 95560abfdd3a1755b69f238eff2954d164dff6a5 (diff) | |
download | Qt-ca2122e9eb2b0d68d4203b05128f6fc5a838f3d6.zip Qt-ca2122e9eb2b0d68d4203b05128f6fc5a838f3d6.tar.gz Qt-ca2122e9eb2b0d68d4203b05128f6fc5a838f3d6.tar.bz2 |
ItemViews: don't commit data from editors when hiding the view
Task-number: 258106
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/itemviews/qitemdelegate.cpp | 2 | ||||
-rw-r--r-- | src/gui/itemviews/qstyleditemdelegate.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/itemviews/qitemdelegate.cpp b/src/gui/itemviews/qitemdelegate.cpp index 7d0f7c6..a285113 100644 --- a/src/gui/itemviews/qitemdelegate.cpp +++ b/src/gui/itemviews/qitemdelegate.cpp @@ -1219,7 +1219,7 @@ 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)) { if (editor->isAncestorOf(QApplication::focusWidget())) diff --git a/src/gui/itemviews/qstyleditemdelegate.cpp b/src/gui/itemviews/qstyleditemdelegate.cpp index 75f2d61..bd8fdac 100644 --- a/src/gui/itemviews/qstyleditemdelegate.cpp +++ b/src/gui/itemviews/qstyleditemdelegate.cpp @@ -671,7 +671,7 @@ bool QStyledItemDelegate::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)) { if (editor->isAncestorOf(QApplication::focusWidget())) |