aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/windows/ComboBox.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/quickcontrols/windows/ComboBox.qml')
-rw-r--r--src/quickcontrols/windows/ComboBox.qml7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/quickcontrols/windows/ComboBox.qml b/src/quickcontrols/windows/ComboBox.qml
index 66fffecb46..e8a0ed738d 100644
--- a/src/quickcontrols/windows/ComboBox.qml
+++ b/src/quickcontrols/windows/ComboBox.qml
@@ -1,6 +1,8 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+pragma ComponentBehavior: Bound
+
import QtQuick
import QtQuick.Window
import QtQuick.Controls
@@ -56,8 +58,11 @@ T.ComboBox {
}
delegate: ItemDelegate {
+ required property var model
+ required property int index
+
width: ListView.view.width
- text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData
+ text: model[control.textRole]
palette.text: control.palette.text
palette.highlightedText: control.palette.highlightedText
font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal