[AttributePin] Add tooltip to display type of attribute

This commit is contained in:
Aurore LAFAURIE 2024-09-10 14:52:49 +02:00
parent 9c33c57305
commit de5ca552f7
2 changed files with 7 additions and 2 deletions

View file

@ -33,7 +33,7 @@ RowLayout {
var tooltip = ""
if (!attribute.validValue && attribute.desc.errorMessage !== "")
tooltip += "<i><b>Error: </b>" + Format.plainToHtml(attribute.desc.errorMessage) + "</i><br><br>"
tooltip += "<b> " + attribute.desc.name + "</b><br>" + Format.plainToHtml(attribute.desc.description)
tooltip += "<b> " + attribute.desc.name + ": " + attribute.type + "</b><br>" + Format.plainToHtml(attribute.desc.description)
parameterTooltip.text = tooltip
}
@ -78,7 +78,7 @@ RowLayout {
var tooltip = ""
if (!object.validValue && object.desc.errorMessage !== "")
tooltip += "<i><b>Error: </b>" + Format.plainToHtml(object.desc.errorMessage) + "</i><br><br>"
tooltip += "<b>" + object.desc.name + "</b><br>" + Format.plainToHtml(object.description)
tooltip += "<b>" + object.desc.name + ": " + attribute.type + "</b><br>" + Format.plainToHtml(object.description)
return tooltip
}
visible: parameterMA.containsMouse

View file

@ -35,6 +35,11 @@ RowLayout {
layoutDirection: Qt.LeftToRight
spacing: 3
ToolTip.text: attribute.name + ": " + attribute.type
ToolTip.visible: nameLabel.hovered
ToolTip.toolTip.y: nameLabel.y + nameLabel.height
ToolTip.toolTip.x: nameLabel.x
function updatePin(isSrc, isVisible)
{
if (isSrc) {