diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-02-02 15:16:08 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-02-10 10:36:47 +0000 |
commit | 51eff608eb18b01d36fdab442930300a4af3df20 (patch) | |
tree | 9822c3c454a97dcd627e4601dedc81bcfde98e46 /src/quicktemplates2/qquickcombobox.cpp | |
parent | 13ece44c44b4214b568ca3638ef62e0f1af04d7f (diff) |
Cancel incubation of replaced/destroyed delegates
Resolves the "Object destroyed during incubation" issues.
Task-number: QTBUG-50992
Change-Id: Ie58c958dafbf915da7494dac25351be98106c6ea
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickcombobox.cpp')
-rw-r--r-- | src/quicktemplates2/qquickcombobox.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/quicktemplates2/qquickcombobox.cpp b/src/quicktemplates2/qquickcombobox.cpp index 59d66d99..f1ff9994 100644 --- a/src/quicktemplates2/qquickcombobox.cpp +++ b/src/quicktemplates2/qquickcombobox.cpp @@ -1069,7 +1069,7 @@ void QQuickComboBox::setIndicator(QQuickItem *indicator) if (d->indicator == indicator) return; - d->deleteDelegate(d->indicator); + QQuickControlPrivate::destroyDelegate(d->indicator, this); d->indicator = indicator; if (indicator) { if (!indicator->parentItem()) @@ -1103,9 +1103,10 @@ void QQuickComboBox::setPopup(QQuickPopup *popup) if (d->popup == popup) return; - if (d->popup) + if (d->popup) { QObjectPrivate::disconnect(d->popup, &QQuickPopup::visibleChanged, d, &QQuickComboBoxPrivate::popupVisibleChanged); - d->deleteDelegate(d->popup); + QQuickControlPrivate::destroyDelegate(d->popup, this); + } if (popup) { QQuickPopupPrivate::get(popup)->allowVerticalFlip = true; popup->setClosePolicy(QQuickPopup::CloseOnEscape | QQuickPopup::CloseOnPressOutsideParent); |