zhengtianzuo |
2017-10-14 16:25 |
zhengtianzuo系列-Qml超链接
``` 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 |
|