aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/quicktemplates2/qquickcombobox.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquickcombobox.cpp b/src/quicktemplates2/qquickcombobox.cpp
index c2fc3aff..78297a8e 100644
--- a/src/quicktemplates2/qquickcombobox.cpp
+++ b/src/quicktemplates2/qquickcombobox.cpp
@@ -672,7 +672,15 @@ QQuickComboBox::QQuickComboBox(QQuickItem *parent)
QQuickComboBox::~QQuickComboBox()
{
- setPopup(nullptr);
+ Q_D(QQuickComboBox);
+ // Disconnect visibleChanged() to avoid a spurious highlightedIndexChanged() signal
+ // emission during the destruction of the (visible) popup. (QTBUG-57650)
+ QObjectPrivate::disconnect(d->popup, &QQuickPopup::visibleChanged, d, &QQuickComboBoxPrivate::popupVisibleChanged);
+
+ // Delete the popup directly instead of calling setPopup(nullptr) to avoid calling
+ // destroyDelegate(popup) and potentially accessing a destroyed QML context. (QTBUG-50992)
+ delete d->popup;
+ d->popup = nullptr;
}
/*!