aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator/qmldesigner/collectionEditorQmlSource/ModelSourceItem.qml
blob: 2678a36755b8c5293f468005d019a329670ec723 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import HelperWidgets 2.0 as HelperWidgets
import StudioControls 1.0 as StudioControls
import StudioTheme as StudioTheme

Item {
    id: root

    implicitWidth: 300
    implicitHeight: collectionListView.height

    property bool hasSelectedTarget

    ListView {
        id: collectionListView

        width: parent.width
        implicitHeight: contentHeight
        leftMargin: 6

        model: internalModels
        clip: true

        delegate: CollectionItem {
            width: collectionListView.width
            sourceType: collectionListView.model.sourceType
            hasSelectedTarget: root.hasSelectedTarget
            onDeleteItem: collectionListView.model.removeRow(index)
        }
    }
}