Skip to content
Open
Changes from 2 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
fa06ae0
Added the tableViewAttributeComponent
raphaelKoskas Jun 19, 2026
0340d3a
Added the listAttributeComponent/tableViewAttributeComponent switch
raphaelKoskas Jun 19, 2026
ea2a73d
Undoable/Redoable value assignment
raphaelKoskas Jun 29, 2026
53d0cbd
tablesView are collapsables/expandables
raphaelKoskas Jun 29, 2026
4371878
Added remove rows buttons for the tableview
raphaelKoskas Jun 29, 2026
4bf74bc
Fix column resize
raphaelKoskas Jun 30, 2026
b65d523
Switched to flickable to handle mouse wheel
raphaelKoskas Jun 30, 2026
64e41f1
Added separated window options and param support rto the table view
raphaelKoskas Jul 10, 2026
0c58d85
Simplified the palette, removed intermediate smaller viariables, resp…
raphaelKoskas Jul 28, 2026
d86729e
added TableView.qml
raphaelKoskas Jul 28, 2026
af21735
added TableViewRowDelegate.qml
raphaelKoskas Jul 28, 2026
b062f66
added TableViewCellDelegate.qml
raphaelKoskas Jul 28, 2026
41a0d95
calls the tableWiew components in AttributeItemDelegate.qml
raphaelKoskas Jul 28, 2026
3628690
tableView : fixed syntax issues, rowHeight is now a fixed value
raphaelKoskas Jul 31, 2026
72b9d3e
Fixed typo
raphaelKoskas Jul 31, 2026
23b6129
Fixed syntax issue
raphaelKoskas Jul 31, 2026
1565b28
Fixed syntax issues
raphaelKoskas Jul 31, 2026
c0ae997
tableView capped column sizes and always visible if applicable hbar
raphaelKoskas Aug 3, 2026
5f33c35
TableViewRowDelegate capped column widths
raphaelKoskas Aug 3, 2026
14d6226
TableViewCellDelegate capped columns widths
raphaelKoskas Aug 3, 2026
fb18985
Fixed highlights and focus erros, added a format for real values
raphaelKoskas Aug 4, 2026
3ce6ed2
fixed focus errors
raphaelKoskas Aug 4, 2026
7ffbb37
fixed typo
raphaelKoskas Aug 4, 2026
a5b2b92
Fixed focus errors
raphaelKoskas Aug 4, 2026
cd3bf12
Fixed typos
raphaelKoskas Aug 4, 2026
a3321af
Fixed typos
raphaelKoskas Aug 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
244 changes: 243 additions & 1 deletion meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,10 @@ RowLayout {
case "BoolParam":
return checkboxComponent
case "ListAttribute":
return listAttributeComponent
if (attribute.baseType == "GroupAttribute")
return tableViewAttributeComponent
Comment thread
raphaelKoskas marked this conversation as resolved.
else
return listAttributeComponent
case "GroupAttribute":
return groupAttributeComponent
case "StringParam":
Expand Down Expand Up @@ -830,6 +833,245 @@ RowLayout {
}
}

Component {
id: tableViewAttributeComponent
ColumnLayout {
id: tableLayout
spacing: 0
width: parent ? parent.width : 400
property var columnNames: {
if (!attribute || !attribute.value || attribute.value.count === 0) return []
var firstRow = attribute.value.at(0)
if (!firstRow || !firstRow.value) return []
var names = []
for (var i = 0; i < firstRow.value.count; i++) {
var child = firstRow.value.at(i)
if (child) names.push(child.label)
}
return names
}
property var columnWidths: []
property var rowHeights: []
property real totalTableWidth: {
var w = columnWidths
if (!w || w.length === 0) return 0
var t = 0
for (var i = 0; i < w.length; i++) t += w[i]
t += Math.max(0, w.length - 1)
return t
}
property real totalTableHeight: {
var h = rowHeights
if (!h || h.length === 0) return 0
var t = 0
for (var i = 0; i < h.length; i++) t += h[i]
t += Math.max(0, h.length - 1)
return t
}
FontMetrics {
id: fontMetrics
font.bold: false
}
function initSizes() {
var names = tableLayout.columnNames
if (!names || names.length === 0) {
tableLayout.columnWidths = []
tableLayout.rowHeights = []
return
}
var widths = []
for (var i = 0; i < names.length; i++)
widths.push(fontMetrics.advanceWidth(names[i]) + 20)
var heights = []
if (attribute && attribute.value) {
for (var r = 0; r < attribute.value.count; r++) {
var rowAttr = attribute.value.at(r)
if (!rowAttr || !rowAttr.value) { heights.push(30); continue }
for (var c = 0; c < rowAttr.value.count && c < widths.length; c++) {
var cell = rowAttr.value.at(c)
var cellText = cell ? String(cell.value) : ""
var cw = fontMetrics.advanceWidth(cellText) + 20
if (cw > widths[c]) widths[c] = cw
}
heights.push(30)
}
}
tableLayout.columnWidths = widths
tableLayout.rowHeights = heights
}
Component.onCompleted: tableLayout.initSizes()
Connections {
target: attribute ? attribute.value : null
function onCountChanged() { tableLayout.initSizes() }
function onModelReset() { tableLayout.initSizes() }
function onRowsInserted() { tableLayout.initSizes() }
function onDataChanged() { tableLayout.initSizes() }
}
Item {
id: outerFrame
Layout.fillWidth: true
Layout.preferredHeight: Math.min(tableLayout.totalTableHeight + 30, 330)
ScrollBar {
id: hBar
orientation: Qt.Horizontal
anchors.left: outerFrame.left
anchors.right: outerFrame.right
anchors.bottom: outerFrame.bottom
anchors.rightMargin: vBar.width
policy: ScrollBar.AlwaysOn
size: (outerFrame.width - vBar.width) /
Math.max(tableLayout.totalTableWidth, 1)
}
ScrollBar {
id: vBar
orientation: Qt.Vertical
anchors.top: outerFrame.top
anchors.bottom: outerFrame.bottom
anchors.right: outerFrame.right
anchors.bottomMargin: hBar.height
policy: ScrollBar.AlwaysOn
size: (outerFrame.height - hBar.height) /
Math.max(tableLayout.totalTableHeight + 30, 1)
}
Item {
id: viewport
anchors.left: outerFrame.left
anchors.top: outerFrame.top
anchors.right: outerFrame.right
anchors.bottom: outerFrame.bottom
anchors.rightMargin: vBar.width
anchors.bottomMargin: hBar.height
clip: true
Item {
id: content
width: tableLayout.totalTableWidth
height: tableLayout.totalTableHeight + 30
x: -hBar.position * tableLayout.totalTableWidth
y: -vBar.position * (tableLayout.totalTableHeight + 30)
Comment thread
raphaelKoskas marked this conversation as resolved.
Outdated
Row {
id: headerRow
spacing: 1
Repeater {
model: tableLayout.columnNames
delegate: Item {
id: headerCell
required property int index
required property string modelData
width: tableLayout.columnWidths[index] || 100
height: 30

Rectangle {
anchors.fill: parent
color: "#2d2d2d"
border.color: "#1d1d1d"
Text {
anchors.fill: parent
text: headerCell.modelData
color: "#aaaaaa"
font.bold: false
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}
}
MouseArea {
width: 6
height: parent.height
anchors.right: parent.right
cursorShape: Qt.SizeHorCursor
property real startX: 0
property real startW: 0
onPressed: function(mouse) {
startX = mouse.x
startW = tableLayout.columnWidths[headerCell.index]
}
onPositionChanged: function(mouse) {
if (!pressed) return
var newW = Math.max(40, startW + (mouse.x - startX))
var arr = tableLayout.columnWidths.slice()
arr[headerCell.index] = newW
tableLayout.columnWidths = arr
}
}
Comment thread
raphaelKoskas marked this conversation as resolved.
Outdated
}
}
}
Column {
spacing: 1
anchors.top: headerRow.bottom
anchors.topMargin: 1
Repeater {
model: attribute ? attribute.value : null
delegate: Item {
id: rowItem
required property int index
required property var object
width: tableLayout.totalTableWidth
height: tableLayout.rowHeights[index] || 30
Row {
spacing: 1
anchors.fill: parent
Repeater {
model: rowItem.object && rowItem.object.value
? rowItem.object.value.count
: 0
delegate: Rectangle {
id: cellRect
required property int index
width: tableLayout.columnWidths[index] || 100
height: rowItem.height
color: rowItem.index % 2 === 0 ? "#2d2d2d" : "#333333"
border.color: cellInput.activeFocus ? "#5599ff" : "#1d1d1d"
clip: true
TextInput {
id: cellInput
anchors.fill: parent
anchors.margins: 4
verticalAlignment: TextInput.AlignVCenter
horizontalAlignment: TextInput.AlignHCenter
color: "#aaaaaa"
selectionColor: "#5599ff"
clip: true
text: {
var cell = rowItem.object.value.at(index)
return cell ? String(cell.value) : ""
}
onEditingFinished: {
var cell = rowItem.object.value.at(cellRect.index)
if (cell) cell.value = text
}
}
Comment thread
raphaelKoskas marked this conversation as resolved.
Outdated
}
}
}
MouseArea {
width: parent.width
height: 6
anchors.bottom: parent.bottom
cursorShape: Qt.SizeVerCursor
property real startY: 0
property real startH: 0
onPressed: function(mouse) {
startY = mouse.y
startH = tableLayout.rowHeights[rowItem.index]
}
onPositionChanged: function(mouse) {
if (!pressed) return
var newH = Math.max(20, startH + (mouse.y - startY))
var arr = tableLayout.rowHeights.slice()
arr[rowItem.index] = newH
tableLayout.rowHeights = arr
}
}
Comment thread
raphaelKoskas marked this conversation as resolved.
Outdated
}
}
}
}
}
}
}
}

Component {
id: groupAttributeComponent
ColumnLayout {
Expand Down
Loading