diff --git a/widgets/DapComboBox.qml b/widgets/DapComboBox.qml index 3698dd704e05b57b625c5be5dd3762211e12358a..1aa258e39ec6ce29d2a533c79ea39315e71d6a72 100644 --- a/widgets/DapComboBox.qml +++ b/widgets/DapComboBox.qml @@ -44,7 +44,7 @@ DapComboBoxForm id: tm font: fontComboBox elide: Text.ElideRight - text: modelData + text: model[comboBoxTextRole] elideWidth: { if(index != currentIndex) diff --git a/widgets/DapComboBoxForm.ui.qml b/widgets/DapComboBoxForm.ui.qml index 829ec783aadbcec199399c89974d4f81776d9fee..9c689e1f68da9326fcb6866009aa78b4d9662923 100644 --- a/widgets/DapComboBoxForm.ui.qml +++ b/widgets/DapComboBoxForm.ui.qml @@ -64,9 +64,13 @@ ComboBox ///@detalis mainLineText Text without unneccesary part. property string mainLineText + ///@detalis comboBoxTextRole The model role used for the ComboBox. + property string comboBoxTextRole: "" + width: popup.visible ? widthPopupComboBoxActive : widthPopupComboBoxNormal height: popup.visible ? heightComboBoxActive : heightComboBoxNormal anchors.verticalCenter: parent.verticalCenter + textRole: comboBoxTextRole //Icon icon near the text (arrow) indicator: