Skip to content

Commit

Permalink
Work around an upstream Qt crash when a relation editor combobox lead…
Browse files Browse the repository at this point in the history
…s to its attribute item to be hidden
  • Loading branch information
nirvn committed Nov 10, 2024
1 parent a5240bc commit 4ab30b8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/qml/RelationCombobox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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" : ""
Expand Down

1 comment on commit 4ab30b8

@qfield-fairy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.