summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qcombobox.cpp
diff options
context:
space:
mode:
authorThorbjørn Martsum <tmartsum@gmail.com>2015-07-02 07:39:32 +0200
committerThorbjørn Lund Martsum <tmartsum@gmail.com>2015-07-08 17:37:33 +0000
commitb9438e6cbdc9768253c7c696e4d9f085c067fe31 (patch)
treeea32bfe665315f17bc9e5a7e75425663f76df4e6 /src/widgets/widgets/qcombobox.cpp
parent6a6d793d857e580cf63b689d03f891710f46487a (diff)
QComboBox::setView only delete the old view if it is a child
We have ownership for a reason - and there seems to be no good reason not to accept it here. [ChangeLog][QtWidgets][QComboBox] QComboBox::setView no longer deletes the old view directly. It now checks the ownership first. Change-Id: Icb5e5c0a6e9dc93c1d1c1a90ff57fbcc0786aa60 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Diffstat (limited to 'src/widgets/widgets/qcombobox.cpp')
-rw-r--r--src/widgets/widgets/qcombobox.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index 0ecbb8a435..232ba6698e 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -546,7 +546,8 @@ void QComboBoxPrivateContainer::setItemView(QAbstractItemView *itemView)
disconnect(view, SIGNAL(destroyed()),
this, SLOT(viewDestroyed()));
- delete view;
+ if (isAncestorOf(view))
+ delete view;
view = 0;
}