moment/harmonyqml/components/Base/HRichLabel.qml
2019-04-28 15:36:43 -04:00

23 lines
512 B
QML

import QtQuick 2.7
HLabel {
id: label
textFormat: Text.RichText
MouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
onPositionChanged: function (event) {
cursorShape = label.linkAt(event.x, event.y) ?
Qt.PointingHandCursor : Qt.ArrowCursor
}
onClicked: function(event) {
var link = label.linkAt(event.x, event.y)
if (link) { Qt.openUrlExternally(link) }
}
}
}