QmlDesigner: Fix ComboBox model issue

This patch enables the ComboBox to properly show models which aren't
raw arrays (e.g. a data model that has multiple named roles).

Change-Id: I126f157e4da04afb768be40190c23720367b3419
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Henning Gruendl
2019-10-02 10:58:40 +02:00
committed by Henning Gründl
parent 005a03ccd4
commit 1347515da6

View File

@@ -131,7 +131,7 @@ T.ComboBox {
contentItem: Text {
leftPadding: itemDelegateIconArea.width
text: modelData
text: myComboBox.textRole ? (Array.isArray(myComboBox.model) ? modelData[myComboBox.textRole] : model[myComboBox.textRole]) : modelData
color: StudioTheme.Values.themeTextColor
font: myComboBox.font
elide: Text.ElideRight