summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qabstractitemview_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/itemviews/qabstractitemview_p.h')
-rw-r--r--src/widgets/itemviews/qabstractitemview_p.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/widgets/itemviews/qabstractitemview_p.h b/src/widgets/itemviews/qabstractitemview_p.h
index 801bb82d85..3826f3b4e9 100644
--- a/src/widgets/itemviews/qabstractitemview_p.h
+++ b/src/widgets/itemviews/qabstractitemview_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -200,13 +200,18 @@ public:
// reimplemented in subclasses
virtual void adjustViewOptionsForIndex(QStyleOptionViewItemV4*, const QModelIndex&) const {}
- inline void releaseEditor(QWidget *editor) const {
+ inline void releaseEditor(QWidget *editor, const QModelIndex &index = QModelIndex()) const {
if (editor) {
QObject::disconnect(editor, SIGNAL(destroyed(QObject*)),
q_func(), SLOT(editorDestroyed(QObject*)));
editor->removeEventFilter(itemDelegate);
editor->hide();
- editor->deleteLater();
+ QAbstractItemDelegate *delegate = delegateForIndex(index);
+
+ if (delegate)
+ delegate->destroyEditor(editor, index);
+ else
+ editor->deleteLater();
}
}