forked from qt-creator/qt-creator
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:
@@ -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 {
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user