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 {
|
Text {
|
||||||
id: recentProjectInfo
|
id: recentProjectInfo
|
||||||
color: Constants.currentGlobalText
|
color: Constants.currentGlobalText
|
||||||
|
linkColor: Constants.currentBrand
|
||||||
text: typeof(description) === "undefined" ? "" : description
|
text: typeof(description) === "undefined" ? "" : description
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
font.pixelSize: 12
|
font.pixelSize: 12
|
||||||
@@ -390,6 +391,17 @@ Item {
|
|||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
anchors.margins: Constants.thumbnailMargin
|
anchors.margins: Constants.thumbnailMargin
|
||||||
anchors.topMargin: 25
|
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 {
|
TagArea {
|
||||||
|
@@ -273,6 +273,11 @@ public:
|
|||||||
QUrl("qthelp://org.qt-project.qtdesignstudio/doc/studio-getting-started.html"));
|
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,
|
Q_INVOKABLE void openExample(const QString &examplePath,
|
||||||
const QString &exampleName,
|
const QString &exampleName,
|
||||||
const QString &formFile,
|
const QString &formFile,
|
||||||
|
Reference in New Issue
Block a user