From 741ab749a682f8654d52b536baeb859a70bae14d 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 ea9041230b..a97e9e6e74 100644 --- a/src/qml/RelationCombobox.qml +++ b/src/qml/RelationCombobox.qml @@ -330,10 +330,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" : ""