moment/src/qml/Base/HRichLabel.qml

23 lines
512 B
QML
Raw Normal View History

2019-04-18 00:54:55 +10:00
import QtQuick 2.7
HLabel {
id: label
2019-04-18 00:54:55 +10:00
textFormat: Text.RichText
MouseArea {
id: mouseArea
2019-04-18 00:54:55 +10:00
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) }
}
}
}