Qml超链接

来源:互联网 发布:java weka 编辑:程序博客网 时间:2024/05/22 05:10
Text {            anchors.centerIn: parent            text: '<html></style><a href="http://www.baidu.com">点击</a></html>'            MouseArea {               anchors.fill: parent;               hoverEnabled: true;               cursorShape:                   (containsMouse? Qt.PointingHandCursor: Qt.ArrowCursor);               onClicked: Qt.openUrlExternally("http://www.baidu.com")           }        }

文本使用html超链接显示, 被点击的时候调用Qt.openUrlExternally来使用默认应用打开超链接

这里写图片描述

需要完整代码请访问QtQuickExamples

原创粉丝点击