Warning, /frameworks/qqc2-desktop-style/tests/testComboBox.qml is written in an unsupported language. File is not indexed.
0001 /* 0002 SPDX-FileCopyrightText: 2019 Aleix Pol <aleixpol@kde.org> 0003 SPDX-FileCopyrightText: 2020 Chris Holland <zrenfire@gmail.com> 0004 0005 SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-or-later 0006 */ 0007 0008 import QtQuick 2.15 0009 import QtQuick.Layouts 1.15 0010 import QtQuick.Controls 2.15 0011 0012 ApplicationWindow 0013 { 0014 visible: true 0015 0016 ColumnLayout { 0017 anchors.fill: parent 0018 ComboBox { 0019 Layout.fillWidth: true 0020 textRole: "key" 0021 model: ListModel { 0022 id: comboModel 0023 ListElement { key: "First"; value: 123 } 0024 ListElement { key: "Second"; value: 456 } 0025 ListElement { key: "Third"; value: 789 } 0026 } 0027 } 0028 0029 ComboBox { 0030 Layout.fillWidth: true 0031 textRole: "key" 0032 model: comboModel 0033 editable: true 0034 } 0035 0036 ListView { 0037 Layout.fillWidth: true 0038 Layout.fillHeight: true 0039 model: comboModel 0040 delegate: Label { text: key } 0041 } 0042 } 0043 }