moment/harmonyqml/components/base/HRichLabel.qml

24 lines
540 B
QML
Raw Normal View History

2019-04-18 00:54:55 +10:00
import QtQuick 2.7
import QtQuick.Controls 2.0
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) }
}
}
}