Warning, /libraries/kpublictransport/tests/AttributionSheet.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2019 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 import QtQuick
0008 import QtQuick.Layouts
0009 import QtQuick.Controls as QQC2
0010 import org.kde.kirigami as Kirigami
0011 
0012 Kirigami.OverlaySheet {
0013     id: aboutSheet
0014     property var attributions
0015 
0016     header: Kirigami.Heading {
0017         text: "Data Providers"
0018     }
0019 
0020     ListView {
0021         model: aboutSheet.attributions
0022         delegate: QQC2.ItemDelegate {
0023             width: ListView.view.width
0024             contentItem: ColumnLayout {
0025                 QQC2.Label {
0026                     text: "<a href=\"" + modelData.url + "\">" + modelData.name + "</a>"
0027                     onLinkActivated: Qt.openUrlExternally(link)
0028                 }
0029                 QQC2.Label {
0030                     text: "License: <a href=\"" + modelData.licenseUrl + "\">" + (modelData.license != "" ? modelData.license : modelData.licenseUrl) + "</a>"
0031                     onLinkActivated: Qt.openUrlExternally(link)
0032                     // FIXME this makes OverlaySheet go completely crazy when we have more entries than fit on the screen
0033                     //visible: modelData.hasLicense
0034                 }
0035             }
0036         }
0037     }
0038 }