KOSMIndoorMap

AttributionPage.qml
1/*
2 SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7import QtQuick
8import QtQuick.Controls as QQC2
9import org.kde.kirigami as Kirigami
10import org.kde.kpublictransport as KPublicTransport
11
12Kirigami.ScrollablePage {
13 id: root
14 title: i18nc("@title:page", "Data Sources")
15
16 required property KPublicTransport.Manager publicTransportManager
17
18 Component {
19 id: attributionDelegate
20 QQC2.ItemDelegate {
21 id: delegate
22 required property KPublicTransport.attribution modelData
23 width: ListView.view.width
24 onClicked: Qt.openUrlExternally(delegate.modelData.url)
25 contentItem: Kirigami.TitleSubtitle {
26 title: delegate.modelData.name
27 subtitle: (delegate.modelData.license.length > 0 || delegate.modelData.licenseUrl.length > 0) ? i18n("License: <a href=\"%1\">%2</a>", delegate.modelData.licenseUrl, delegate.modelData.license.length > 0 ? delegate.modelData.license : delegate.modelData.licenseUrl) : i18n("License: Other")
28 onLinkActivated: link => Qt.openUrlExternally(link)
29 }
30 }
31 }
32
33 ListView {
34 model: root.publicTransportManager.attributions
35 delegate: attributionDelegate
36 }
37}
QString i18n(const char *text, const TYPE &arg...)
KIOCORE_EXPORT CopyJob * link(const QList< QUrl > &src, const QUrl &destDir, JobFlags flags=DefaultFlags)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:11:15 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.