Meshroom/meshroom/ui/qml/AttributeEditor.qml
Yann Lanthony 00366cda00 [ui] introduce first functional UI with a graph editor
First functional UI that allows to visualize, modify and execute a graph locally.
* use QtQuick Controls 2 + Shapes (Qt >=5.10)
* main menu to save/load a graph
2017-10-31 16:54:16 +01:00

60 lines
1.5 KiB
QML

import QtQuick 2.9
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.2
/**
A component to display and edit a Node's attributes.
*/
ColumnLayout {
id: root
// the node to edit
property variant node: null
SystemPalette { id: palette }
Button {
text: "Open Node Folder"
onClicked: Qt.openUrlExternally("file://" + node.internalFolder)
ToolTip.text: node.internalFolder
ToolTip.visible: hovered
}
ListView {
id: attributesListView
Layout.fillHeight: true
Layout.fillWidth: true
clip: true
spacing: 4
ScrollBar.vertical: ScrollBar {}
model: node ? node.attributes : undefined
delegate: RowLayout {
width: attributesListView.width
spacing: 4
Label {
id: parameterLabel
text: object.label
Layout.preferredWidth: 200
color: object.isOutput ? "orange" : palette.text
ToolTip.text: object.desc.description
ToolTip.visible: parameterMA.containsMouse
ToolTip.delay: 200
MouseArea {
id: parameterMA
anchors.fill: parent
hoverEnabled: true
}
}
AttributeItemDelegate {
Layout.fillWidth: true
height: childrenRect.height
attribute: object
}
}
}
}