summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2009-08-04 18:06:04 (GMT)
committerGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2009-08-04 18:17:16 (GMT)
commit8e01aa83880bf9cc669106f1e219abd3b3fca186 (patch)
treef37dc8353e6a90f18446b793436caad18079dd29 /src
parenta22f422b20299a501c307b21a6095ece87749124 (diff)
downloadQt-8e01aa83880bf9cc669106f1e219abd3b3fca186.zip
Qt-8e01aa83880bf9cc669106f1e219abd3b3fca186.tar.gz
Qt-8e01aa83880bf9cc669106f1e219abd3b3fca186.tar.bz2
Fixed bug where Q[Styled]ItemDelegate edition wouldn't terminate when
the item lost focus to an unrelated dialog. The tests against the active modal window was unnecessary. Task-number: 257859 Reviewed-by: olivier
Diffstat (limited to 'src')
-rw-r--r--src/gui/itemviews/qitemdelegate.cpp7
-rw-r--r--src/gui/itemviews/qstyleditemdelegate.cpp8
2 files changed, 2 insertions, 13 deletions
diff --git a/src/gui/itemviews/qitemdelegate.cpp b/src/gui/itemviews/qitemdelegate.cpp
index aff715c..962ce54 100644
--- a/src/gui/itemviews/qitemdelegate.cpp
+++ b/src/gui/itemviews/qitemdelegate.cpp
@@ -1238,12 +1238,7 @@ bool QItemDelegate::eventFilter(QObject *object, QEvent *event)
if (QDragManager::self() && QDragManager::self()->object != 0)
return false;
#endif
- // Opening a modal dialog will start a new eventloop
- // that will process the deleteLater event.
- if (QApplication::activeModalWidget()
- && !QApplication::activeModalWidget()->isAncestorOf(editor)
- && qobject_cast<QDialog*>(QApplication::activeModalWidget()))
- return false;
+
emit commitData(editor);
emit closeEditor(editor, NoHint);
}
diff --git a/src/gui/itemviews/qstyleditemdelegate.cpp b/src/gui/itemviews/qstyleditemdelegate.cpp
index 7ec2afe..8faf0be 100644
--- a/src/gui/itemviews/qstyleditemdelegate.cpp
+++ b/src/gui/itemviews/qstyleditemdelegate.cpp
@@ -686,13 +686,7 @@ bool QStyledItemDelegate::eventFilter(QObject *object, QEvent *event)
if (QDragManager::self() && QDragManager::self()->object != 0)
return false;
#endif
- // Opening a modal dialog will start a new eventloop
- // that will process the deleteLater event.
- QWidget *activeModalWidget = QApplication::activeModalWidget();
- if (activeModalWidget
- && !activeModalWidget->isAncestorOf(editor)
- && qobject_cast<QDialog*>(activeModalWidget))
- return false;
+
emit commitData(editor);
emit closeEditor(editor, NoHint);
}