forked from qt-creator/qt-creator
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:
committed by
Henning Gründl
parent
005a03ccd4
commit
1347515da6
@@ -131,7 +131,7 @@ T.ComboBox {
|
|||||||
|
|
||||||
contentItem: Text {
|
contentItem: Text {
|
||||||
leftPadding: itemDelegateIconArea.width
|
leftPadding: itemDelegateIconArea.width
|
||||||
text: modelData
|
text: myComboBox.textRole ? (Array.isArray(myComboBox.model) ? modelData[myComboBox.textRole] : model[myComboBox.textRole]) : modelData
|
||||||
color: StudioTheme.Values.themeTextColor
|
color: StudioTheme.Values.themeTextColor
|
||||||
font: myComboBox.font
|
font: myComboBox.font
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
|
Reference in New Issue
Block a user