diff options
author | Ulf Hermann <[email protected]> | 2023-03-16 09:38:54 +0100 |
---|---|---|
committer | Ulf Hermann <[email protected]> | 2023-03-27 12:52:34 +0100 |
commit | 05ae4d743b76aff4cc1a1c3d5aebc96e9f16f662 (patch) | |
tree | f88e7c310d8844e2efd6c58cbec945f36a69f73a /src/quickcontrols/basic/ComboBox.qml | |
parent | 86794e82ea92cff3b36bbb58f813b625f0230e51 (diff) |
Controls: Improve various delegates
Their internal components should be bound, they should use required
properties, and they should prefer IDs over the "parent" property.
Change-Id: Iac61a4d7b9daf34928a1b41a29658e491e3ac39f
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Mitch Curtis <[email protected]>
Diffstat (limited to 'src/quickcontrols/basic/ComboBox.qml')
-rw-r--r-- | src/quickcontrols/basic/ComboBox.qml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/quickcontrols/basic/ComboBox.qml b/src/quickcontrols/basic/ComboBox.qml index 33d1ef5907..5c71a4398e 100644 --- a/src/quickcontrols/basic/ComboBox.qml +++ b/src/quickcontrols/basic/ComboBox.qml @@ -1,6 +1,8 @@ // Copyright (C) 2017 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.Controls.impl import QtQuick.Templates as T @@ -18,6 +20,9 @@ T.ComboBox { rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) delegate: ItemDelegate { + required property var model + required property int index + width: ListView.view.width text: model[control.textRole] palette.text: control.palette.text |