From b9e94da0dcfe6b374c31bf8b924d4bbfaad72bb2 Mon Sep 17 00:00:00 2001 From: Mathieu Pellerin Date: Sun, 10 Nov 2024 10:23:34 +0700 Subject: [PATCH] Work around an upstream Qt crash when a relation editor combobox leads to its attribute item to be hidden --- src/qml/RelationCombobox.qml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/qml/RelationCombobox.qml b/src/qml/RelationCombobox.qml index e74dc4380d..6a001d3eab 100644 --- a/src/qml/RelationCombobox.qml +++ b/src/qml/RelationCombobox.qml @@ -327,10 +327,17 @@ Item { topMargin: mainWindow.sceneTopMargin bottomMargin: mainWindow.sceneTopMargin + onAboutToShow: { + contentItem.model = comboBox.delegateModel; + } + + onAboutToHide: { + contentItem.model = null; + } + contentItem: ListView { clip: true implicitHeight: Math.min(mainWindow.height - mainWindow.sceneTopMargin - mainWindow.sceneTopMargin, contentHeight) - model: comboBox.popup.visible ? comboBox.delegateModel : null currentIndex: comboBox.highlightedIndex section.property: featureListModel.groupField != "" ? "groupFieldValue" : ""