moment/src/qml/Base/HRichLabel.qml

18 lines
467 B
QML
Raw Normal View History

2019-07-08 13:52:41 +10:00
// Copyright 2019 miruka
// This file is part of harmonyqml, licensed under LGPLv3.
import QtQuick 2.12
2019-04-18 00:54:55 +10:00
HLabel {
// https://blog.shantanu.io/2015/02/15/creating-working-hyperlinks-in-qtquick-text/
id: label
2019-04-18 00:54:55 +10:00
textFormat: Text.RichText
onLinkActivated: Qt.openUrlExternally(link)
2019-04-18 00:54:55 +10:00
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
2019-04-18 00:54:55 +10:00
}
}