[ui] AttributeEditor: add contextual menu on attributes

* allow to expose additional actions on individuals attributes
* add 'Reset to Default Value' action
This commit is contained in:
Yann Lanthony 2018-02-05 18:26:24 +01:00
parent 4a71ebb212
commit c45ebdf83c

View file

@ -49,8 +49,24 @@ RowLayout {
hoverEnabled: true
acceptedButtons: Qt.AllButtons
property Component menuComp: Menu {
id: paramMenu
MenuItem {
text: "Reset To Default Value"
enabled: !attribute.isOutput && !attribute.isLink && !attribute.isDefault
onTriggered: _reconstruction.resetAttribute(attribute)
}
}
onClicked: {
forceActiveFocus()
if(mouse.button == Qt.RightButton)
{
var menu = menuComp.createObject(parameterLabel)
menu.parent = parameterLabel
menu.popup()
}
}
}
}