KOSMIndoorMap

OSMElementInformationDialogLinkDelegate.qml
1/*
2 SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@kde.org>
3 SPDX-License-Identifier: LGPL-2.0-or-later
4*/
5
6import QtQuick
7import QtQuick.Layouts
8import QtQuick.Controls as QQC2
9import org.kde.kirigami as Kirigami
11/** OSM element info dialog delegate for graphically displaying link entries. */
12RowLayout {
13 id: root
14
15 /** Key name. */
16 required property string keyLabel
17 /** Value category. */
18 required property int category
19 /** Link label of this entry. */
20 required property string value
21 /** URL of this entry. */
22 required property string url
23
24 QQC2.Label {
25 visible: root.keyLabel !== ""
26 text: root.keyLabel + ":"
27 color: root.category === OSMElementInformationModel.DebugCategory ? Kirigami.Theme.disabledTextColor : Kirigami.Theme.textColor
28 Layout.alignment: Qt.AlignTop
29 }
30 QQC2.Label {
31 Layout.fillWidth: true
32 text: "<a href=\"" + root.url + "\">" + root.value + "</a>"
33 color: (row && row.category == OSMElementInformationModel.DebugCategory) ? Kirigami.Theme.disabledTextColor : Kirigami.Theme.textColor
34 onLinkActivated: Qt.openUrlExternally(link)
35 wrapMode: Text.WordWrap
36 }
37}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 26 2024 11:57:46 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.