QmlDesigner: Enable links in descriptions

Task-number: QDS-13773
Change-Id: Ie36dee2ab6c962487489d544cb596a389554641d
Reviewed-by: Knud Dollereder <knud.dollereder@qt.io>
This commit is contained in:
Thomas Hartmann
2024-10-17 15:09:48 +02:00
parent 81f846ce1c
commit 82150e2cee
2 changed files with 17 additions and 0 deletions

View File

@@ -382,6 +382,7 @@ Item {
Text {
id: recentProjectInfo
color: Constants.currentGlobalText
linkColor: Constants.currentBrand
text: typeof(description) === "undefined" ? "" : description
anchors.fill: parent
font.pixelSize: 12
@@ -390,6 +391,17 @@ Item {
wrapMode: Text.WordWrap
anchors.margins: Constants.thumbnailMargin
anchors.topMargin: 25
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
cursorShape: recentProjectInfo.hoveredLink === "" ? Qt.ArrowCursor : Qt.PointingHandCursor
}
Connections {
target: recentProjectInfo
onLinkActivated: (link)=> Constants.projectModel.showLink(link)
}
}
TagArea {

View File

@@ -273,6 +273,11 @@ public:
QUrl("qthelp://org.qt-project.qtdesignstudio/doc/studio-getting-started.html"));
}
Q_INVOKABLE void showLink(const QString &link)
{
QDesktopServices::openUrl(QUrl::fromUserInput(link));
}
Q_INVOKABLE void openExample(const QString &examplePath,
const QString &exampleName,
const QString &formFile,