QmlDesigner: Add a tooltip option to HelperWidgets.Section's caption

Change-Id: Ic266daa53d1daab4b7b38927eafe4cc939bb3ac2
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
This commit is contained in:
Mahmoud Badri
2025-04-11 01:26:48 +03:00
parent 7c11cd1a1e
commit 13092d905c

View File

@@ -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