summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-07-16 14:56:08 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-07-16 14:57:01 (GMT)
commitca2122e9eb2b0d68d4203b05128f6fc5a838f3d6 (patch)
tree6d402b6b3970e8c3adc3e0f2a0e0bfed035311c5 /src/gui
parent95560abfdd3a1755b69f238eff2954d164dff6a5 (diff)
downloadQt-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.cpp2
-rw-r--r--src/gui/itemviews/qstyleditemdelegate.cpp2
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()))