2019-04-18 00:54:55 +10:00
|
|
|
import QtQuick 2.7
|
|
|
|
|
|
|
|
HLabel {
|
2019-04-21 07:45:51 +10:00
|
|
|
id: label
|
2019-04-18 00:54:55 +10:00
|
|
|
textFormat: Text.RichText
|
|
|
|
|
|
|
|
MouseArea {
|
2019-04-21 07:45:51 +10:00
|
|
|
id: mouseArea
|
2019-04-18 00:54:55 +10:00
|
|
|
anchors.fill: parent
|
|
|
|
hoverEnabled: true
|
2019-07-05 09:23:40 +10:00
|
|
|
propagateComposedEvents: true
|
2019-04-18 00:54:55 +10:00
|
|
|
|
2019-07-05 15:54:29 +10:00
|
|
|
onPositionChanged: function (mouse) {
|
|
|
|
mouse.accepted = false
|
|
|
|
cursorShape = label.linkAt(mouse.x, mouse.y) ?
|
2019-04-18 00:54:55 +10:00
|
|
|
Qt.PointingHandCursor : Qt.ArrowCursor
|
|
|
|
}
|
|
|
|
|
2019-07-05 15:54:29 +10:00
|
|
|
onClicked: function(mouse) {
|
|
|
|
var link = label.linkAt(mouse.x, mouse.y)
|
|
|
|
mouse.accepted = Boolean(link)
|
2019-04-18 00:54:55 +10:00
|
|
|
if (link) { Qt.openUrlExternally(link) }
|
|
|
|
}
|
2019-07-05 15:54:29 +10:00
|
|
|
|
|
|
|
onPressAndHold: mouse.accepted = false
|
|
|
|
onDoubleClicked: mouse.accepted = false
|
|
|
|
onPressed: mouse.accepted = false
|
|
|
|
onReleased: mouse.accepted = false
|
|
|
|
onWheel: mouse.accepted = false
|
2019-04-18 00:54:55 +10:00
|
|
|
}
|
|
|
|
}
|