From 13092d905c41a2bdeb43bf28ae9490c9788f8beb Mon Sep 17 00:00:00 2001 From: Mahmoud Badri Date: Fri, 11 Apr 2025 01:26:48 +0300 Subject: [PATCH] QmlDesigner: Add a tooltip option to HelperWidgets.Section's caption MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic266daa53d1daab4b7b38927eafe4cc939bb3ac2 Reviewed-by: Henning Gründl --- .../imports/HelperWidgets/Section.qml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml index 0f192f8875f..4cc0c747f73 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml @@ -13,6 +13,7 @@ Item { readonly property bool __isSection: true // used by property search logic property string caption: "Title" + property string captionTooltip: "" property color labelColor: StudioTheme.Values.themeTextColor property int labelCapitalization: Font.AllUppercase property alias sectionHeight: header.height @@ -40,6 +41,20 @@ Item { font.capitalization: section.labelCapitalization anchors.verticalCenter: parent?.verticalCenter textFormat: Text.RichText + + MouseArea { + id: labelMouseArea + + anchors.fill: parent + acceptedButtons: Qt.NoButton + hoverEnabled: true + enabled: section.captionTooltip !== "" + } + + StudioControls.ToolTip { + visible: labelMouseArea.containsMouse + text: section.captionTooltip + } } property Item icons