From 089d54f06ff327f5212cb08fdbcb540066357dd5 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sun, 19 Jan 2020 19:40:56 +0100 Subject: Sync behavior and documentation of QFoo::setItemDelegate() QComboBox::setItemDelegate() does delete the old delegate which is in constrast to all other setItemDelegate() functions which is quite confusing. Sync in by *not* deleting the delegate in QComboBox::setItemDelegate() and adjust the documentation to explicitly state that the ownership is *not* passed to the affected classes. [ChangeLog][QtWidgets][QComboBox] QComobBox::setItemDelegates no longer deletes the previous delegate set. Fixes: QTBUG-72483 Change-Id: I89c8e53903e7c9924a980c57b83ce40f5866e6ae Reviewed-by: Friedemann Kleint Reviewed-by: Richard Moe Gustavsen --- src/widgets/itemviews/qdatawidgetmapper.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/widgets/itemviews') diff --git a/src/widgets/itemviews/qdatawidgetmapper.cpp b/src/widgets/itemviews/qdatawidgetmapper.cpp index 24039c42f6..74100c077e 100644 --- a/src/widgets/itemviews/qdatawidgetmapper.cpp +++ b/src/widgets/itemviews/qdatawidgetmapper.cpp @@ -383,6 +383,9 @@ QAbstractItemModel *QDataWidgetMapper::model() const data from the model into the widget and from the widget to the model, using QAbstractItemDelegate::setEditorData() and QAbstractItemDelegate::setModelData(). + Any existing delegate will be removed, but not deleted. QDataWidgetMapper + does not take ownership of \a delegate. + The delegate also decides when to apply data and when to change the editor, using QAbstractItemDelegate::commitData() and QAbstractItemDelegate::closeEditor(). -- cgit v1.2.3