From 7cd45c776b65055dd6150e2312fe27373ce234d1 Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Thu, 6 Aug 2026 16:44:25 +0200 Subject: [PATCH 01/26] [GraphEditor] Took out Slider Component --- .../GraphEditor/AttributeControls/Slider.qml | 84 +++++++++++++++++++ .../qml/GraphEditor/AttributeItemDelegate.qml | 82 +----------------- 2 files changed, 87 insertions(+), 79 deletions(-) create mode 100644 meshroom/ui/qml/GraphEditor/AttributeControls/Slider.qml diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/Slider.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/Slider.qml new file mode 100644 index 0000000000..4ffc46c7b1 --- /dev/null +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/Slider.qml @@ -0,0 +1,84 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +import Utils + +RowLayout { + id: root + required property var attribute + property bool editable + ExpressionTextField { + id: expressionTextField + implicitWidth: 100 + Layout.fillWidth: !slider.active + enabled: root.editable + // Cast value to string to avoid intrusive scientific notations on numbers + property string displayValue: String(slider.active && slider.item.pressed ? slider.item.formattedValue : + attribute.keyable ? attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) : + attribute.value) + text: displayValue + selectByMouse: true + // Note: Use autoScroll as a workaround for alignment + // When the value change keep the text align to the left to be able to read the most important part + // of the number. When we are editing (item is in focus), the content should follow the editing. + autoScroll: activeFocus + isInt: attribute.type === "FloatParam" ? false : true + onEditingFinished: { + if (!hasExprError) { + setTextFieldAttribute(expressionTextField.evaluatedValue) + // Restore binding + expressionTextField.text = Qt.binding(function() { return String(expressionTextField.displayValue); }) + } + } + background: Rectangle { + border.color: errorMessages.length ? "orange" : "transparent" + color: Qt.darker(palette.window, 1.2) + radius: 2 + } + onAccepted: { + if (!hasExprError) { + setTextFieldAttribute(expressionTextField.evaluatedValue) + // Restore binding + expressionTextField.text = Qt.binding(function() { return String(expressionTextField.displayValue); }) + } + // When the text is too long, display the left part + // (with the most important values and cut the floating point details) + ensureVisible(0) + } + Component.onDestruction: { + if (activeFocus) { + if (!hasExprError) + setTextFieldAttribute(expressionTextField.evaluatedValue) + } + } + Component.onCompleted: { + // When the text is too long, display the left part + // (with the most important values and cut the floating point details) + ensureVisible(0) + } + } + Loader { + id: slider + Layout.fillWidth: true + active: attribute.desc.range.length === 3 + sourceComponent: Slider { + readonly property int stepDecimalCount: stepSize < 1 ? String(stepSize).split(".").pop().length : 0 + readonly property real formattedValue: value.toFixed(stepDecimalCount) + enabled: root.editable + value: attribute.keyable ? attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) : attribute.value + from: attribute.desc.range[0] + to: attribute.desc.range[1] + stepSize: attribute.desc.range[2] + snapMode: Slider.SnapAlways + onPressedChanged: { + if (!pressed) { + if (attribute.keyable) + _currentScene.addAttributeKeyValue(attribute, _currentScene.selectedViewId, formattedValue) + else + _currentScene.setAttribute(attribute, formattedValue) + } + } + } + } +} \ No newline at end of file diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index 4667189181..c9a632b761 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -811,85 +811,9 @@ RowLayout { Component { id: sliderComponent - RowLayout { - ExpressionTextField { - id: expressionTextField - implicitWidth: 100 - Layout.fillWidth: !slider.active - enabled: root.editable - // Cast value to string to avoid intrusive scientific notations on numbers - property string displayValue: String(slider.active && slider.item.pressed ? slider.item.formattedValue : - attribute.keyable ? attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) : - attribute.value) - text: displayValue - selectByMouse: true - // Note: Use autoScroll as a workaround for alignment - // When the value change keep the text align to the left to be able to read the most important part - // of the number. When we are editing (item is in focus), the content should follow the editing. - autoScroll: activeFocus - isInt: attribute.type === "FloatParam" ? false : true - onEditingFinished: { - if (!hasExprError) { - setTextFieldAttribute(expressionTextField.evaluatedValue) - // Restore binding - expressionTextField.text = Qt.binding(function() { return String(expressionTextField.displayValue); }) - } - } - - background: Rectangle { - border.color: errorMessages.length ? "orange" : "transparent" - color: Qt.darker(palette.window, 1.2) - radius: 2 - } - - onAccepted: { - if (!hasExprError) { - setTextFieldAttribute(expressionTextField.evaluatedValue) - // Restore binding - expressionTextField.text = Qt.binding(function() { return String(expressionTextField.displayValue); }) - } - // When the text is too long, display the left part - // (with the most important values and cut the floating point details) - ensureVisible(0) - } - - Component.onDestruction: { - if (activeFocus) { - if (!hasExprError) - setTextFieldAttribute(expressionTextField.evaluatedValue) - } - } - Component.onCompleted: { - // When the text is too long, display the left part - // (with the most important values and cut the floating point details) - ensureVisible(0) - } - } - - Loader { - id: slider - Layout.fillWidth: true - active: attribute.desc.range.length === 3 - sourceComponent: Slider { - readonly property int stepDecimalCount: stepSize < 1 ? String(stepSize).split(".").pop().length : 0 - readonly property real formattedValue: value.toFixed(stepDecimalCount) - enabled: root.editable - value: attribute.keyable ? attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) : attribute.value - from: attribute.desc.range[0] - to: attribute.desc.range[1] - stepSize: attribute.desc.range[2] - snapMode: Slider.SnapAlways - - onPressedChanged: { - if (!pressed) { - if (attribute.keyable) - _currentScene.addAttributeKeyValue(attribute, _currentScene.selectedViewId, formattedValue) - else - _currentScene.setAttribute(attribute, formattedValue) - } - } - } - } + AttributeControls.Slider{ + attribute: root.attribute + editable: root.editable } } From f1103bc749c2e2d86733c933b524681665443f62 Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Thu, 6 Aug 2026 16:54:04 +0200 Subject: [PATCH 02/26] [GraphEditor] Took out notComputed Component --- .../AttributeControls/NotComputed.qml | 16 ++++++++++++++++ .../ui/qml/GraphEditor/AttributeItemDelegate.qml | 14 +------------- 2 files changed, 17 insertions(+), 13 deletions(-) create mode 100644 meshroom/ui/qml/GraphEditor/AttributeControls/NotComputed.qml diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/NotComputed.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/NotComputed.qml new file mode 100644 index 0000000000..e077cdcff2 --- /dev/null +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/NotComputed.qml @@ -0,0 +1,16 @@ +import QtQuick +import MaterialIcons + +MaterialLabel { + anchors.fill: parent + text: MaterialIcons.do_not_disturb_alt + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + padding: 4 + background: Rectangle { + anchors.fill: parent + border.width: 0 + radius: 20 + color: Qt.darker(palette.window, 1.1) + } +} \ No newline at end of file diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index c9a632b761..5af5105c79 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -478,19 +478,7 @@ RowLayout { Component { id: notComputedComponent - MaterialLabel { - anchors.fill: parent - text: MaterialIcons.do_not_disturb_alt - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - padding: 4 - background: Rectangle { - anchors.fill: parent - border.width: 0 - radius: 20 - color: Qt.darker(palette.window, 1.1) - } - } + AttributeControls.NotComputed{} } Component { From 38e0b37d0fe347a41007af25d0d66a77fbc337c0 Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Thu, 6 Aug 2026 17:22:17 +0200 Subject: [PATCH 03/26] [GraphEditor] Took out PushButton Component --- .../ui/qml/GraphEditor/AttributeControls/PushButton.qml | 8 ++++++++ meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 meshroom/ui/qml/GraphEditor/AttributeControls/PushButton.qml diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/PushButton.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/PushButton.qml new file mode 100644 index 0000000000..54bb47c93f --- /dev/null +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/PushButton.qml @@ -0,0 +1,8 @@ +import QtQuick +import QtQuick.Controls + +Button { + id: root + required property string label + text: label +} \ No newline at end of file diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index 5af5105c79..ff6b8b7434 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -483,8 +483,8 @@ RowLayout { Component { id: pushButtonComponent - Button { - text: attribute.label + AttributeControls.PushButton{ + label: attribute.label enabled: root.editable onClicked: { attribute.clicked() From 87bf13b4222aa4e647ac880a8576f5890a113197 Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Thu, 6 Aug 2026 17:39:33 +0200 Subject: [PATCH 04/26] [GraphEditor] Took out TextField Component --- .../AttributeControls/TextField.qml | 126 +++++++++++++++++ .../qml/GraphEditor/AttributeItemDelegate.qml | 131 +----------------- 2 files changed, 130 insertions(+), 127 deletions(-) create mode 100644 meshroom/ui/qml/GraphEditor/AttributeControls/TextField.qml diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/TextField.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/TextField.qml new file mode 100644 index 0000000000..ce7578b689 --- /dev/null +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/TextField.qml @@ -0,0 +1,126 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +RowLayout { + id: root + required property string text + required property bool mandatory + property bool editable + anchors.fill: parent + TextField { + id: textField + Layout.fillWidth: true + readOnly: !root.editable + text: root.text + placeholderText: root.mandatory ? "This field is required" : "" + placeholderTextColor: "gray" + // Don't disable the component to keep interactive features (text selection, context menu...). + // Only override the look by using the Disabled palette. + SystemPalette { + id: disabledPalette + colorGroup: SystemPalette.Disabled + } + background: Rectangle { + border.color: errorMessages.length ? "orange" : "transparent" + color: Qt.darker(palette.window, 1.2) + radius: 2 + } + states: [ + State { + when: readOnly + PropertyChanges { + target: textField + color: disabledPalette.text + } + } + ] + selectByMouse: true + persistentSelection: false + onEditingFinished: { + setTextFieldAttribute(text) + } + onAccepted: { + setTextFieldAttribute(text) + parameterLabel.forceActiveFocus() + } + Keys.onPressed: function(event) { + if ((event.key == Qt.Key_Escape)) { + event.accepted = true + parameterLabel.forceActiveFocus() + } + } + Component.onDestruction: { + if (activeFocus) + setTextFieldAttribute(text) + } + DropArea { + enabled: root.editable + anchors.fill: parent + onDropped: function(drop) { + if (drop.hasUrls) + setTextFieldAttribute(Filepath.urlToString(drop.urls[0])) + else if (drop.hasText && drop.text != '') + setTextFieldAttribute(drop.text) + } + } + onPressed: (event) => { + if (event.button == Qt.RightButton) { + // Keep selection persistent while context menu is open to + // visualize what is being copied or what will be replaced on paste. + persistentSelection = true + const menu = textFieldMenuComponent.createObject(textField) + menu.popup() + if (selectedText === "") { + cursorPosition = positionAt(event.x, event.y) + } + } + } + Component { + id: textFieldMenuComponent + Menu { + onOpened: { + // Keep cursor visible to see where pasting would happen. + textField.cursorVisible = true + } + onClosed: { + // Disable selection persistency behavior once menu is closed and + // give focus back to the parent TextField. + textField.persistentSelection = false + textField.forceActiveFocus() + destroy() + } + MenuItem { + text: "Copy" + enabled: root.text != "" + onTriggered: { + const hasSelection = textField.selectionStart !== textField.selectionEnd + if (hasSelection) { + // Use `TextField.copy` to copy only the current selection. + textField.copy() + } + else { + Clipboard.setText(root.text) + } + } + } + MenuItem { + text: "Paste" + enabled: !readOnly + onTriggered: { + const clipboardText = Clipboard.getText() + if (clipboardText.length === 0) { + return + } + const before = textField.text.substr(0, textField.selectionStart) + const after = textField.text.substr(textField.selectionEnd, textField.text.length) + const updatedValue = before + clipboardText + after + setTextFieldAttribute(updatedValue) + // Set the cursor at the end of the added text + textField.cursorPosition = before.length + clipboardText.length + } + } + } + } + } +} \ No newline at end of file diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index ff6b8b7434..d5503d672b 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -500,133 +500,10 @@ RowLayout { Component { id: textFieldComponent - - RowLayout { - anchors.fill: parent - - TextField { - id: textField - Layout.fillWidth: true - - readOnly: !root.editable - text: attribute.value - placeholderText: attribute.isMandatory ? "This field is required" : "" - placeholderTextColor: "gray" - // Don't disable the component to keep interactive features (text selection, context menu...). - // Only override the look by using the Disabled palette. - SystemPalette { - id: disabledPalette - colorGroup: SystemPalette.Disabled - } - - background: Rectangle { - border.color: errorMessages.length ? "orange" : "transparent" - color: Qt.darker(palette.window, 1.2) - radius: 2 - } - - states: [ - State { - when: readOnly - PropertyChanges { - target: textField - color: disabledPalette.text - } - } - ] - - selectByMouse: true - persistentSelection: false - - onEditingFinished: { - setTextFieldAttribute(text) - } - - onAccepted: { - setTextFieldAttribute(text) - parameterLabel.forceActiveFocus() - } - Keys.onPressed: function(event) { - if ((event.key == Qt.Key_Escape)) { - event.accepted = true - parameterLabel.forceActiveFocus() - } - } - Component.onDestruction: { - if (activeFocus) - setTextFieldAttribute(text) - } - DropArea { - enabled: root.editable - anchors.fill: parent - onDropped: function(drop) { - if (drop.hasUrls) - setTextFieldAttribute(Filepath.urlToString(drop.urls[0])) - else if (drop.hasText && drop.text != '') - setTextFieldAttribute(drop.text) - } - } - onPressed: (event) => { - if (event.button == Qt.RightButton) { - // Keep selection persistent while context menu is open to - // visualize what is being copied or what will be replaced on paste. - persistentSelection = true - const menu = textFieldMenuComponent.createObject(textField) - menu.popup() - - if (selectedText === "") { - cursorPosition = positionAt(event.x, event.y) - } - } - } - - Component { - id: textFieldMenuComponent - Menu { - onOpened: { - // Keep cursor visible to see where pasting would happen. - textField.cursorVisible = true - } - onClosed: { - // Disable selection persistency behavior once menu is closed and - // give focus back to the parent TextField. - textField.persistentSelection = false - textField.forceActiveFocus() - destroy() - } - MenuItem { - text: "Copy" - enabled: attribute.value != "" - onTriggered: { - const hasSelection = textField.selectionStart !== textField.selectionEnd - if (hasSelection) { - // Use `TextField.copy` to copy only the current selection. - textField.copy() - } - else { - Clipboard.setText(attribute.value) - } - } - } - MenuItem { - text: "Paste" - enabled: !readOnly - onTriggered: { - const clipboardText = Clipboard.getText() - if (clipboardText.length === 0) { - return - } - const before = textField.text.substr(0, textField.selectionStart) - const after = textField.text.substr(textField.selectionEnd, textField.text.length) - const updatedValue = before + clipboardText + after - setTextFieldAttribute(updatedValue) - // Set the cursor at the end of the added text - textField.cursorPosition = before.length + clipboardText.length - } - } - } - } - } + AttributeControls.TextField{ + text: attribute.value + mandatory: attribute.isMandatory + editable: root.editable } } From 4868df8b96d980f8e1cd3a66cc8675bab2b4441b Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Thu, 6 Aug 2026 17:51:15 +0200 Subject: [PATCH 05/26] [GraphEditor] Took out TextArea Component --- .../AttributeControls/TextArea.qml | 57 +++++++++++++++++++ .../qml/GraphEditor/AttributeItemDelegate.qml | 56 ++---------------- 2 files changed, 61 insertions(+), 52 deletions(-) create mode 100644 meshroom/ui/qml/GraphEditor/AttributeControls/TextArea.qml diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/TextArea.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/TextArea.qml new file mode 100644 index 0000000000..1c425dd1a3 --- /dev/null +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/TextArea.qml @@ -0,0 +1,57 @@ +import QtQuick +import QtQuick.Controls + +import Controls + +Rectangle { + id: root + required property string label + property bool isLarge + property bool editable + + // Fixed background for the flickable object + color: palette.base + width: parent.width + height: root.isLarge ? 400 : 70 + Flickable { + width: parent.width + height: parent.height + contentWidth: width + contentHeight: height + ScrollBar.vertical: MScrollBar {} + TextArea.flickable: TextArea { + wrapMode: Text.WordWrap + padding: 0 + rightPadding: 5 + bottomPadding: 2 + topPadding: 2 + readOnly: !root.editable + onEditingFinished: setTextFieldAttribute(text) + text: root.label + selectByMouse: true + background: Rectangle { + visible: errorMessages.length + border.color: "orange" + color: "transparent" + radius: 2 + } + onPressed: { + root.forceActiveFocus() + } + Component.onDestruction: { + if (activeFocus) + setTextFieldAttribute(text) + } + DropArea { + enabled: root.editable + anchors.fill: parent + onDropped: { + if (drop.hasUrls) + setTextFieldAttribute(Filepath.urlToString(drop.urls[0])) + else if (drop.hasText && drop.text != '') + setTextFieldAttribute(drop.text) + } + } + } + } +} \ No newline at end of file diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index d5503d672b..3e6f819d1e 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -509,58 +509,10 @@ RowLayout { Component { id: textAreaComponent - - Rectangle { - // Fixed background for the flickable object - color: palette.base - width: parent.width - height: attribute.desc.semantic.includes("large") ? 400 : 70 - - Flickable { - width: parent.width - height: parent.height - contentWidth: width - contentHeight: height - - ScrollBar.vertical: MScrollBar {} - - TextArea.flickable: TextArea { - wrapMode: Text.WordWrap - padding: 0 - rightPadding: 5 - bottomPadding: 2 - topPadding: 2 - readOnly: !root.editable - onEditingFinished: setTextFieldAttribute(text) - text: attribute.value - selectByMouse: true - - background: Rectangle { - visible: errorMessages.length - border.color: "orange" - color: "transparent" - radius: 2 - } - - onPressed: { - root.forceActiveFocus() - } - Component.onDestruction: { - if (activeFocus) - setTextFieldAttribute(text) - } - DropArea { - enabled: root.editable - anchors.fill: parent - onDropped: { - if (drop.hasUrls) - setTextFieldAttribute(Filepath.urlToString(drop.urls[0])) - else if (drop.hasText && drop.text != '') - setTextFieldAttribute(drop.text) - } - } - } - } + AttributeControls.TextArea{ + label: attribute.value + isLarge: attribute.desc.semantic.includes("large") + editable: root.editable } } From 48fd621dcedff4c89e54eb896cf4011f69e2e241 Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Thu, 6 Aug 2026 17:57:21 +0200 Subject: [PATCH 06/26] [GraphEditor] Took out Color Component --- .../GraphEditor/AttributeControls/Color.qml | 76 +++++++++++++++++++ .../qml/GraphEditor/AttributeItemDelegate.qml | 73 +----------------- 2 files changed, 79 insertions(+), 70 deletions(-) create mode 100644 meshroom/ui/qml/GraphEditor/AttributeControls/Color.qml diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/Color.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/Color.qml new file mode 100644 index 0000000000..8eaa3941de --- /dev/null +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/Color.qml @@ -0,0 +1,76 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.Dialogs + +RowLayout { + id: root + required property var attribute + property bool editable + CheckBox { + id: colorCheckbox + Layout.alignment: Qt.AlignLeft + checked: attribute.value === "" ? false : true + checkable: root.editable + text: "Custom Color" + property string previousColor: "" + onClicked: { + if (checked) { + if (colorText.text == "") { + if (previousColor != "") + _currentScene.setAttribute(attribute, previousColor) + else + _currentScene.setAttribute(attribute, "#0000FF") + } + else + _currentScene.setAttribute(attribute, colorText.text) + } else { + previousColor = attribute.value + _currentScene.setAttribute(attribute, "") + } + } + } + TextField { + id: colorText + Layout.alignment: Qt.AlignLeft + implicitWidth: 100 + enabled: colorCheckbox.checked && root.editable + visible: colorCheckbox.checked + text: colorCheckbox.checked ? attribute.value : "" + selectByMouse: true + onEditingFinished: setTextFieldAttribute(text) + onAccepted: setTextFieldAttribute(text) + Component.onDestruction: { + if (activeFocus) + setTextFieldAttribute(text) + } + } + Rectangle { + height: colorText.height + width: colorText.width / 2 + Layout.alignment: Qt.AlignLeft + visible: colorCheckbox.checked + color: colorCheckbox.checked ? colorDialog.selectedColor : "" + MouseArea { + enabled: root.editable + anchors.fill: parent + onClicked: colorDialog.open() + } + } + ColorDialog { + id: colorDialog + title: "Please choose a color" + selectedColor: colorText.text + onAccepted: { + colorText.text = colorDialog.selectedColor + // Artificially trigger change of attribute value + colorText.editingFinished() + close() + } + onRejected: close() + } + Item { + // Dummy item to fill out the space if needed + Layout.fillWidth: true + } +} \ No newline at end of file diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index 3e6f819d1e..baf5788a9b 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -518,76 +518,9 @@ RowLayout { Component { id: colorComponent - RowLayout { - CheckBox { - id: colorCheckbox - Layout.alignment: Qt.AlignLeft - checked: attribute.value === "" ? false : true - checkable: root.editable - text: "Custom Color" - property string previousColor: "" - onClicked: { - if (checked) { - if (colorText.text == "") { - if (previousColor != "") - _currentScene.setAttribute(attribute, previousColor) - else - _currentScene.setAttribute(attribute, "#0000FF") - } - else - _currentScene.setAttribute(attribute, colorText.text) - } else { - previousColor = attribute.value - _currentScene.setAttribute(attribute, "") - } - } - } - TextField { - id: colorText - Layout.alignment: Qt.AlignLeft - implicitWidth: 100 - enabled: colorCheckbox.checked && root.editable - visible: colorCheckbox.checked - text: colorCheckbox.checked ? attribute.value : "" - selectByMouse: true - onEditingFinished: setTextFieldAttribute(text) - onAccepted: setTextFieldAttribute(text) - Component.onDestruction: { - if (activeFocus) - setTextFieldAttribute(text) - } - } - - Rectangle { - height: colorText.height - width: colorText.width / 2 - Layout.alignment: Qt.AlignLeft - visible: colorCheckbox.checked - color: colorCheckbox.checked ? colorDialog.selectedColor : "" - - MouseArea { - enabled: root.editable - anchors.fill: parent - onClicked: colorDialog.open() - } - } - - ColorDialog { - id: colorDialog - title: "Please choose a color" - selectedColor: colorText.text - onAccepted: { - colorText.text = colorDialog.selectedColor - // Artificially trigger change of attribute value - colorText.editingFinished() - close() - } - onRejected: close() - } - Item { - // Dummy item to fill out the space if needed - Layout.fillWidth: true - } + AttributeControls.Color{ + attribute: root.attribute + editable: root.editable } } From 9f4ba8ef84d271eedd71d5d1439bae76d2a8dc5b Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Thu, 6 Aug 2026 18:02:26 +0200 Subject: [PATCH 07/26] [GraphEditor] Took out CheckBox Component --- .../qml/GraphEditor/AttributeItemDelegate.qml | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index baf5788a9b..a8d7a925bb 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -569,22 +569,9 @@ RowLayout { Component { id: checkboxComponent - Row { - CheckBox { - enabled: root.editable - checked: attribute.keyable ? attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) : attribute.value - onToggled: { - if(attribute.keyable) - { - const value = attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) - _currentScene.addAttributeKeyValue(attribute, _currentScene.selectedViewId, !value) - } - else - { - _currentScene.setAttribute(attribute, !attribute.value) - } - } - } + AttributeControls.CheckBox{ + attribute: root.attribute + editable: root.editable } } From ccbdb9afb3a56ee61a70c0f0aa3b9b5c62997fea Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Thu, 6 Aug 2026 18:03:54 +0200 Subject: [PATCH 08/26] [GraphEditor] Adding the checkBox qml file --- .../AttributeControls/CheckBox.qml | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 meshroom/ui/qml/GraphEditor/AttributeControls/CheckBox.qml diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/CheckBox.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/CheckBox.qml new file mode 100644 index 0000000000..42e5737e4a --- /dev/null +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/CheckBox.qml @@ -0,0 +1,23 @@ +import QtQuick +import QtQuick.Controls + +Row { + id: root + required property var attribute + property bool editable + CheckBox { + enabled: root.editable + checked: attribute.keyable ? attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) : attribute.value + onToggled: { + if(attribute.keyable) + { + const value = attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) + _currentScene.addAttributeKeyValue(attribute, _currentScene.selectedViewId, !value) + } + else + { + _currentScene.setAttribute(attribute, !attribute.value) + } + } + } +} \ No newline at end of file From 170209f09e706613236e1046369fa044ebaad1ee Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Fri, 7 Aug 2026 12:04:27 +0200 Subject: [PATCH 09/26] [GraphEditor] Fixed setTextFieldAttribute errors --- .../qml/GraphEditor/AttributeControls/Color.qml | 6 +++--- .../qml/GraphEditor/AttributeControls/Slider.qml | 6 +++--- .../GraphEditor/AttributeControls/TextArea.qml | 9 +++++---- .../GraphEditor/AttributeControls/TextField.qml | 13 +++++++------ .../ui/qml/GraphEditor/AttributeItemDelegate.qml | 16 +++++++++------- 5 files changed, 27 insertions(+), 23 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/Color.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/Color.qml index 8eaa3941de..65a6c39836 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeControls/Color.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/Color.qml @@ -38,11 +38,11 @@ RowLayout { visible: colorCheckbox.checked text: colorCheckbox.checked ? attribute.value : "" selectByMouse: true - onEditingFinished: setTextFieldAttribute(text) - onAccepted: setTextFieldAttribute(text) + onEditingFinished: setTextFieldAttribute(root.attribute, text) + onAccepted: setTextFieldAttribute(root.attribute, text) Component.onDestruction: { if (activeFocus) - setTextFieldAttribute(text) + setTextFieldAttribute(root.attribute, text) } } Rectangle { diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/Slider.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/Slider.qml index 4ffc46c7b1..87eeb958ad 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeControls/Slider.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/Slider.qml @@ -26,7 +26,7 @@ RowLayout { isInt: attribute.type === "FloatParam" ? false : true onEditingFinished: { if (!hasExprError) { - setTextFieldAttribute(expressionTextField.evaluatedValue) + setTextFieldAttribute(root.attribute, expressionTextField.evaluatedValue) // Restore binding expressionTextField.text = Qt.binding(function() { return String(expressionTextField.displayValue); }) } @@ -38,7 +38,7 @@ RowLayout { } onAccepted: { if (!hasExprError) { - setTextFieldAttribute(expressionTextField.evaluatedValue) + setTextFieldAttribute(root.attribute, expressionTextField.evaluatedValue) // Restore binding expressionTextField.text = Qt.binding(function() { return String(expressionTextField.displayValue); }) } @@ -49,7 +49,7 @@ RowLayout { Component.onDestruction: { if (activeFocus) { if (!hasExprError) - setTextFieldAttribute(expressionTextField.evaluatedValue) + setTextFieldAttribute(root.attribute, expressionTextField.evaluatedValue) } } Component.onCompleted: { diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/TextArea.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/TextArea.qml index 1c425dd1a3..c6e6271f31 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeControls/TextArea.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/TextArea.qml @@ -6,6 +6,7 @@ import Controls Rectangle { id: root required property string label + required property var attribute property bool isLarge property bool editable @@ -26,7 +27,7 @@ Rectangle { bottomPadding: 2 topPadding: 2 readOnly: !root.editable - onEditingFinished: setTextFieldAttribute(text) + onEditingFinished: setTextFieldAttribute(root.attribute, text) text: root.label selectByMouse: true background: Rectangle { @@ -40,16 +41,16 @@ Rectangle { } Component.onDestruction: { if (activeFocus) - setTextFieldAttribute(text) + setTextFieldAttribute(root.attribute, text) } DropArea { enabled: root.editable anchors.fill: parent onDropped: { if (drop.hasUrls) - setTextFieldAttribute(Filepath.urlToString(drop.urls[0])) + setTextFieldAttribute(root.attribute, Filepath.urlToString(drop.urls[0])) else if (drop.hasText && drop.text != '') - setTextFieldAttribute(drop.text) + setTextFieldAttribute(root.attribute, drop.text) } } } diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/TextField.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/TextField.qml index ce7578b689..47fe5770ed 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeControls/TextField.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/TextField.qml @@ -6,6 +6,7 @@ RowLayout { id: root required property string text required property bool mandatory + required property var attribute property bool editable anchors.fill: parent TextField { @@ -38,10 +39,10 @@ RowLayout { selectByMouse: true persistentSelection: false onEditingFinished: { - setTextFieldAttribute(text) + setTextFieldAttribute(root.attribute, text) } onAccepted: { - setTextFieldAttribute(text) + setTextFieldAttribute(root.attribute, text) parameterLabel.forceActiveFocus() } Keys.onPressed: function(event) { @@ -52,16 +53,16 @@ RowLayout { } Component.onDestruction: { if (activeFocus) - setTextFieldAttribute(text) + setTextFieldAttribute(root.attribute, text) } DropArea { enabled: root.editable anchors.fill: parent onDropped: function(drop) { if (drop.hasUrls) - setTextFieldAttribute(Filepath.urlToString(drop.urls[0])) + setTextFieldAttribute(root.attribute, Filepath.urlToString(drop.urls[0])) else if (drop.hasText && drop.text != '') - setTextFieldAttribute(drop.text) + setTextFieldAttribute(root.attribute, drop.text) } } onPressed: (event) => { @@ -115,7 +116,7 @@ RowLayout { const before = textField.text.substr(0, textField.selectionStart) const after = textField.text.substr(textField.selectionEnd, textField.text.length) const updatedValue = before + clipboardText + after - setTextFieldAttribute(updatedValue) + setTextFieldAttribute(root.attribute, updatedValue) // Set the cursor at the end of the added text textField.cursorPosition = before.length + clipboardText.length } diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index a8d7a925bb..acbb328870 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -413,7 +413,7 @@ RowLayout { } } - function setTextFieldAttribute(value) { + function setTextFieldAttribute(attr, value) { // editingFinished called even when TextField is readonly if (!editable) return @@ -424,13 +424,13 @@ RowLayout { if(attribute.keyable) _currentScene.addAttributeKeyValue(root.attribute, _currentScene.selectedViewId, Number(value)) else - _currentScene.setAttribute(root.attribute, Number(value)) + _currentScene.setAttribute(attr, Number(value)) break case "File": - _currentScene.setAttribute(root.attribute, value) + _currentScene.setAttribute(attr, value) break default: - _currentScene.setAttribute(root.attribute, value.trim()) + _currentScene.setAttribute(attr, value.trim()) break } } @@ -503,6 +503,7 @@ RowLayout { AttributeControls.TextField{ text: attribute.value mandatory: attribute.isMandatory + attribute: root.attribute editable: root.editable } } @@ -512,6 +513,7 @@ RowLayout { AttributeControls.TextArea{ label: attribute.value isLarge: attribute.desc.semantic.includes("large") + attribute: root.attribute editable: root.editable } } @@ -764,11 +766,11 @@ RowLayout { validator: DoubleValidator { locale: 'C' // Use '.' decimal separator disregarding the system locale } - onEditingFinished: setTextFieldAttribute(text) - onAccepted: setTextFieldAttribute(text) + onEditingFinished: setTextFieldAttribute(root.attribute, text) + onAccepted: setTextFieldAttribute(root.attribute, text) Component.onDestruction: { if (activeFocus) - setTextFieldAttribute(text) + setTextFieldAttribute(root.attribute, text) } } Rectangle { From 668138180069fef27f7a0598f5876b2b7e96912d Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Fri, 7 Aug 2026 12:12:39 +0200 Subject: [PATCH 10/26] [GraphEditor] Took out ColorHue Component --- .../AttributeControls/ColorHue.qml | 53 +++++++++++++++++++ .../qml/GraphEditor/AttributeItemDelegate.qml | 50 ++--------------- 2 files changed, 56 insertions(+), 47 deletions(-) create mode 100644 meshroom/ui/qml/GraphEditor/AttributeControls/ColorHue.qml diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/ColorHue.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/ColorHue.qml new file mode 100644 index 0000000000..a0992224a8 --- /dev/null +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/ColorHue.qml @@ -0,0 +1,53 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +RowLayout { + id: root + required property var attribute + property bool editable + TextField { + implicitWidth: 100 + enabled: root.editable + // Cast value to string to avoid intrusive scientific notations on numbers + property string displayValue: String(slider.pressed ? slider.formattedValue : attribute.value) + text: displayValue + selectByMouse: true + validator: DoubleValidator { + locale: 'C' // Use '.' decimal separator disregarding the system locale + } + onEditingFinished: setTextFieldAttribute(root.attribute, text) + onAccepted: setTextFieldAttribute(root.attribute, text) + Component.onDestruction: { + if (activeFocus) + setTextFieldAttribute(root.attribute, text) + } + } + Rectangle { + height: slider.height + width: height + color: Qt.hsla(slider.pressed ? slider.formattedValue : attribute.value, 1, 0.5, 1) + } + Slider { + id: slider + Layout.fillWidth: true + readonly property int stepDecimalCount: 2 + readonly property real formattedValue: value.toFixed(stepDecimalCount) + enabled: root.editable + value: attribute.value + from: 0 + to: 1 + stepSize: 0.01 + snapMode: Slider.SnapAlways + onPressedChanged: { + if (!pressed) + _currentScene.setAttribute(attribute, formattedValue) + } + background: ShaderEffect { + width: slider.availableWidth + height: slider.availableHeight + blending: false + fragmentShader: "qrc:/shaders/AttributeItemDelegate.frag.qsb" + } + } +} \ No newline at end of file diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index acbb328870..e9aabdf9ca 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -755,53 +755,9 @@ RowLayout { Component { id: colorHueComponent - RowLayout { - TextField { - implicitWidth: 100 - enabled: root.editable - // Cast value to string to avoid intrusive scientific notations on numbers - property string displayValue: String(slider.pressed ? slider.formattedValue : attribute.value) - text: displayValue - selectByMouse: true - validator: DoubleValidator { - locale: 'C' // Use '.' decimal separator disregarding the system locale - } - onEditingFinished: setTextFieldAttribute(root.attribute, text) - onAccepted: setTextFieldAttribute(root.attribute, text) - Component.onDestruction: { - if (activeFocus) - setTextFieldAttribute(root.attribute, text) - } - } - Rectangle { - height: slider.height - width: height - color: Qt.hsla(slider.pressed ? slider.formattedValue : attribute.value, 1, 0.5, 1) - } - Slider { - id: slider - Layout.fillWidth: true - - readonly property int stepDecimalCount: 2 - readonly property real formattedValue: value.toFixed(stepDecimalCount) - enabled: root.editable - value: attribute.value - from: 0 - to: 1 - stepSize: 0.01 - snapMode: Slider.SnapAlways - onPressedChanged: { - if (!pressed) - _currentScene.setAttribute(attribute, formattedValue) - } - - background: ShaderEffect { - width: slider.availableWidth - height: slider.availableHeight - blending: false - fragmentShader: "qrc:/shaders/AttributeItemDelegate.frag.qsb" - } - } + AttributeControls.ColorHue{ + attribute: root.attribute + editable: root.editable } } } From d308ab4398f1921e16ac22af3f95528b00bd79af Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Fri, 7 Aug 2026 16:18:46 +0200 Subject: [PATCH 11/26] [GraphEditor] Made checkbox component agnostic --- .../AttributeControls/CheckBox.qml | 19 ++++++++----------- .../qml/GraphEditor/AttributeItemDelegate.qml | 15 ++++++++++++++- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/CheckBox.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/CheckBox.qml index 42e5737e4a..0a8e25f4eb 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeControls/CheckBox.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/CheckBox.qml @@ -3,21 +3,18 @@ import QtQuick.Controls Row { id: root - required property var attribute property bool editable + property bool keyable + property var keyedValue + property var plainValue + signal wasFired() CheckBox { enabled: root.editable - checked: attribute.keyable ? attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) : attribute.value + checked: root.keyable + ? root.keyedValue + : root.plainValue onToggled: { - if(attribute.keyable) - { - const value = attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) - _currentScene.addAttributeKeyValue(attribute, _currentScene.selectedViewId, !value) - } - else - { - _currentScene.setAttribute(attribute, !attribute.value) - } + root.wasFired() } } } \ No newline at end of file diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index e9aabdf9ca..c96e8bc8b7 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -572,8 +572,21 @@ RowLayout { Component { id: checkboxComponent AttributeControls.CheckBox{ - attribute: root.attribute editable: root.editable + keyable: root.attribute.keyable + keyedValue: attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) + plainValue: attribute.value + onWasFired: { + if(root.attribute.keyable) + { + const value = root.attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) + _currentScene.addAttributeKeyValue(root.attribute, _currentScene.selectedViewId, !value) + } + else + { + _currentScene.setAttribute(root.attribute, !root.attribute.value) + } + } } } From e5b7a00aeb5594ed0350323561be91e9b8daf502 Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Fri, 7 Aug 2026 16:56:55 +0200 Subject: [PATCH 12/26] [GraphEditor] Renamed checkBox signal --- meshroom/ui/qml/GraphEditor/AttributeControls/CheckBox.qml | 4 ++-- meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/CheckBox.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/CheckBox.qml index 0a8e25f4eb..e12fc52a57 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeControls/CheckBox.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/CheckBox.qml @@ -7,14 +7,14 @@ Row { property bool keyable property var keyedValue property var plainValue - signal wasFired() + signal toggled() CheckBox { enabled: root.editable checked: root.keyable ? root.keyedValue : root.plainValue onToggled: { - root.wasFired() + root.toggled() } } } \ No newline at end of file diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index c96e8bc8b7..96cd213002 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -576,7 +576,7 @@ RowLayout { keyable: root.attribute.keyable keyedValue: attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) plainValue: attribute.value - onWasFired: { + onToggled: { if(root.attribute.keyable) { const value = root.attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) From f170b8a31899173db30e842832d76f994aeb7ecc Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Tue, 11 Aug 2026 12:33:39 +0200 Subject: [PATCH 13/26] [GraphEditor] Color attribute changes --- .../GraphEditor/AttributeControls/Color.qml | 28 ++++++------------- .../qml/GraphEditor/AttributeItemDelegate.qml | 21 ++++++++++++++ 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/Color.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/Color.qml index 65a6c39836..6d6992d50e 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeControls/Color.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/Color.qml @@ -7,6 +7,11 @@ RowLayout { id: root required property var attribute property bool editable + property string previousColor : "" + signal clicked(var checked, var previousColor, var colorTextValue) + signal editingFinished(var text) + signal accepted(var text) + signal destruction(bool activeFocus, var text) CheckBox { id: colorCheckbox Layout.alignment: Qt.AlignLeft @@ -15,19 +20,7 @@ RowLayout { text: "Custom Color" property string previousColor: "" onClicked: { - if (checked) { - if (colorText.text == "") { - if (previousColor != "") - _currentScene.setAttribute(attribute, previousColor) - else - _currentScene.setAttribute(attribute, "#0000FF") - } - else - _currentScene.setAttribute(attribute, colorText.text) - } else { - previousColor = attribute.value - _currentScene.setAttribute(attribute, "") - } + root.clicked(checked, previousColor, colorText.text) } } TextField { @@ -38,12 +31,9 @@ RowLayout { visible: colorCheckbox.checked text: colorCheckbox.checked ? attribute.value : "" selectByMouse: true - onEditingFinished: setTextFieldAttribute(root.attribute, text) - onAccepted: setTextFieldAttribute(root.attribute, text) - Component.onDestruction: { - if (activeFocus) - setTextFieldAttribute(root.attribute, text) - } + onEditingFinished: root.editingFinished( text) + onAccepted: root.accepted(text) + Component.onDestruction: root.destruction(activeFocus, text) } Rectangle { height: colorText.height diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index 96cd213002..5e70d2be2e 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -523,6 +523,27 @@ RowLayout { AttributeControls.Color{ attribute: root.attribute editable: root.editable + onClicked: (checked, previousColor, colorTextValue) =>{ + if (checked) { + if (colorTextValue == "") { + if (previousColor != "") + _currentScene.setAttribute(root.attribute, previousColor) + else + _currentScene.setAttribute(root.attribute, "#0000FF") + } + else + _currentScene.setAttribute(root.attribute, colorTextValue) + } else { + previousColor = root.attribute.value + _currentScene.setAttribute(root.attribute, "") + } + } + onEditingFinished: (text) => setTextFieldAttribute(root.attribute, text) + onAccepted: (text) => setTextFieldAttribute(root.attribute, text) + onDestruction: (activeFocus, text) => { + if (activeFocus) + setTextFieldAttribute(root.attribute, text) + } } } From 3c3323373dbebd3c9a3e1b8dcce473c781eeeffb Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Tue, 11 Aug 2026 18:57:26 +0200 Subject: [PATCH 14/26] [GraphEditor] Made color component agnostic --- meshroom/ui/qml/GraphEditor/AttributeControls/Color.qml | 4 ++-- meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/Color.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/Color.qml index 6d6992d50e..620501bdb0 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeControls/Color.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/Color.qml @@ -7,7 +7,7 @@ RowLayout { id: root required property var attribute property bool editable - property string previousColor : "" + property string previousColor: "" signal clicked(var checked, var previousColor, var colorTextValue) signal editingFinished(var text) signal accepted(var text) @@ -18,9 +18,9 @@ RowLayout { checked: attribute.value === "" ? false : true checkable: root.editable text: "Custom Color" - property string previousColor: "" onClicked: { root.clicked(checked, previousColor, colorText.text) + } } TextField { diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index 5e70d2be2e..379fbb3e7c 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -521,12 +521,13 @@ RowLayout { Component { id: colorComponent AttributeControls.Color{ + id: colorControl attribute: root.attribute editable: root.editable onClicked: (checked, previousColor, colorTextValue) =>{ if (checked) { if (colorTextValue == "") { - if (previousColor != "") + if (previousColor !== "") _currentScene.setAttribute(root.attribute, previousColor) else _currentScene.setAttribute(root.attribute, "#0000FF") @@ -534,7 +535,7 @@ RowLayout { else _currentScene.setAttribute(root.attribute, colorTextValue) } else { - previousColor = root.attribute.value + colorControl.previousColor = root.attribute.value _currentScene.setAttribute(root.attribute, "") } } From 0cfa64181054907d2304d06ed9fb9af79682d1b5 Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Wed, 12 Aug 2026 12:52:07 +0200 Subject: [PATCH 15/26] [GraphEditor] Renamed components to avoid confusion with Qt.Controls components --- .../AttributeControls/{CheckBox.qml => CheckBoxRow.qml} | 0 .../AttributeControls/{Slider.qml => SliderField.qml} | 0 .../AttributeControls/{TextArea.qml => TextAreaFlick.qml} | 0 .../AttributeControls/{TextField.qml => TextFieldRow.qml} | 0 meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml | 8 ++++---- 5 files changed, 4 insertions(+), 4 deletions(-) rename meshroom/ui/qml/GraphEditor/AttributeControls/{CheckBox.qml => CheckBoxRow.qml} (100%) rename meshroom/ui/qml/GraphEditor/AttributeControls/{Slider.qml => SliderField.qml} (100%) rename meshroom/ui/qml/GraphEditor/AttributeControls/{TextArea.qml => TextAreaFlick.qml} (100%) rename meshroom/ui/qml/GraphEditor/AttributeControls/{TextField.qml => TextFieldRow.qml} (100%) diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/CheckBox.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/CheckBoxRow.qml similarity index 100% rename from meshroom/ui/qml/GraphEditor/AttributeControls/CheckBox.qml rename to meshroom/ui/qml/GraphEditor/AttributeControls/CheckBoxRow.qml diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/Slider.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/SliderField.qml similarity index 100% rename from meshroom/ui/qml/GraphEditor/AttributeControls/Slider.qml rename to meshroom/ui/qml/GraphEditor/AttributeControls/SliderField.qml diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/TextArea.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/TextAreaFlick.qml similarity index 100% rename from meshroom/ui/qml/GraphEditor/AttributeControls/TextArea.qml rename to meshroom/ui/qml/GraphEditor/AttributeControls/TextAreaFlick.qml diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/TextField.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/TextFieldRow.qml similarity index 100% rename from meshroom/ui/qml/GraphEditor/AttributeControls/TextField.qml rename to meshroom/ui/qml/GraphEditor/AttributeControls/TextFieldRow.qml diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index 379fbb3e7c..ffa44c933d 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -500,7 +500,7 @@ RowLayout { Component { id: textFieldComponent - AttributeControls.TextField{ + AttributeControls.TextFieldRow{ text: attribute.value mandatory: attribute.isMandatory attribute: root.attribute @@ -510,7 +510,7 @@ RowLayout { Component { id: textAreaComponent - AttributeControls.TextArea{ + AttributeControls.TextAreaFlick{ label: attribute.value isLarge: attribute.desc.semantic.includes("large") attribute: root.attribute @@ -585,7 +585,7 @@ RowLayout { Component { id: sliderComponent - AttributeControls.Slider{ + AttributeControls.SliderField{ attribute: root.attribute editable: root.editable } @@ -593,7 +593,7 @@ RowLayout { Component { id: checkboxComponent - AttributeControls.CheckBox{ + AttributeControls.CheckBoxRow{ editable: root.editable keyable: root.attribute.keyable keyedValue: attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) From 8d6557b4f45d724b3eaad6a8236e3583c5580dca Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Wed, 12 Aug 2026 14:50:54 +0200 Subject: [PATCH 16/26] [GraphEditor] Made colorhue component agnostic --- .../AttributeControls/ColorHue.qml | 20 +++++++++---------- .../qml/GraphEditor/AttributeItemDelegate.qml | 10 ++++++++++ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/ColorHue.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/ColorHue.qml index a0992224a8..39db82f4e2 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeControls/ColorHue.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/ColorHue.qml @@ -6,6 +6,10 @@ RowLayout { id: root required property var attribute property bool editable + signal editingFinished(var text) + signal accepted(var text) + signal destruction(bool activeFocus, var text) + signal pressedChanged(bool pressed, var formattedValue) TextField { implicitWidth: 100 enabled: root.editable @@ -16,12 +20,9 @@ RowLayout { validator: DoubleValidator { locale: 'C' // Use '.' decimal separator disregarding the system locale } - onEditingFinished: setTextFieldAttribute(root.attribute, text) - onAccepted: setTextFieldAttribute(root.attribute, text) - Component.onDestruction: { - if (activeFocus) - setTextFieldAttribute(root.attribute, text) - } + onEditingFinished: root.editingFinished(text) + onAccepted: root.accepted(text) + Component.onDestruction: root.destruction(activeFocus, text) } Rectangle { height: slider.height @@ -34,15 +35,12 @@ RowLayout { readonly property int stepDecimalCount: 2 readonly property real formattedValue: value.toFixed(stepDecimalCount) enabled: root.editable - value: attribute.value + value: root.attribute.value from: 0 to: 1 stepSize: 0.01 snapMode: Slider.SnapAlways - onPressedChanged: { - if (!pressed) - _currentScene.setAttribute(attribute, formattedValue) - } + onPressedChanged: root.pressedChanged(pressed, formattedValue) background: ShaderEffect { width: slider.availableWidth height: slider.availableHeight diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index ffa44c933d..71494bd6d5 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -793,6 +793,16 @@ RowLayout { AttributeControls.ColorHue{ attribute: root.attribute editable: root.editable + onEditingFinished: (text) => setTextFieldAttribute(root.attribute, text) + onAccepted: (text) => setTextFieldAttribute(root.attribute, text) + onDestruction: (activeFocus, text) => { + if (activeFocus) + setTextFieldAttribute(root.attribute, text) + } + onPressedChanged: (pressed, formattedValue) => { + if (!pressed) + _currentScene.setAttribute(root.attribute, formattedValue) + } } } } From acbfa9d07eb078183df6a0b0c7ff1cd4fb65f90a Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Tue, 18 Aug 2026 16:27:07 +0200 Subject: [PATCH 17/26] [GraphEditor] Added a whitespace between the braces and the identifier --- .../ui/qml/GraphEditor/AttributeItemDelegate.qml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index 71494bd6d5..60182e959f 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -478,12 +478,12 @@ RowLayout { Component { id: notComputedComponent - AttributeControls.NotComputed{} + AttributeControls.NotComputed {} } Component { id: pushButtonComponent - AttributeControls.PushButton{ + AttributeControls.PushButton { label: attribute.label enabled: root.editable onClicked: { @@ -500,7 +500,7 @@ RowLayout { Component { id: textFieldComponent - AttributeControls.TextFieldRow{ + AttributeControls.TextFieldRow { text: attribute.value mandatory: attribute.isMandatory attribute: root.attribute @@ -510,7 +510,7 @@ RowLayout { Component { id: textAreaComponent - AttributeControls.TextAreaFlick{ + AttributeControls.TextAreaFlick { label: attribute.value isLarge: attribute.desc.semantic.includes("large") attribute: root.attribute @@ -520,7 +520,7 @@ RowLayout { Component { id: colorComponent - AttributeControls.Color{ + AttributeControls.Color { id: colorControl attribute: root.attribute editable: root.editable @@ -585,7 +585,7 @@ RowLayout { Component { id: sliderComponent - AttributeControls.SliderField{ + AttributeControls.SliderField { attribute: root.attribute editable: root.editable } @@ -593,7 +593,7 @@ RowLayout { Component { id: checkboxComponent - AttributeControls.CheckBoxRow{ + AttributeControls.CheckBoxRow { editable: root.editable keyable: root.attribute.keyable keyedValue: attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) @@ -790,7 +790,7 @@ RowLayout { Component { id: colorHueComponent - AttributeControls.ColorHue{ + AttributeControls.ColorHue { attribute: root.attribute editable: root.editable onEditingFinished: (text) => setTextFieldAttribute(root.attribute, text) From 96b99088ba5c1cdd5c293c6010167585c9cdce5f Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Wed, 12 Aug 2026 19:26:44 +0200 Subject: [PATCH 18/26] [GraphEditor] Removed attribute properties in the components --- .../GraphEditor/AttributeControls/Color.qml | 8 +-- .../AttributeControls/ColorHue.qml | 8 +-- .../AttributeControls/SliderField.qml | 67 ++++++++----------- .../qml/GraphEditor/AttributeItemDelegate.qml | 44 +++++++++++- 4 files changed, 76 insertions(+), 51 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/Color.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/Color.qml index 620501bdb0..784e737abd 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeControls/Color.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/Color.qml @@ -5,7 +5,7 @@ import QtQuick.Dialogs RowLayout { id: root - required property var attribute + required property var value property bool editable property string previousColor: "" signal clicked(var checked, var previousColor, var colorTextValue) @@ -15,7 +15,7 @@ RowLayout { CheckBox { id: colorCheckbox Layout.alignment: Qt.AlignLeft - checked: attribute.value === "" ? false : true + checked: root.value === "" ? false : true checkable: root.editable text: "Custom Color" onClicked: { @@ -29,7 +29,7 @@ RowLayout { implicitWidth: 100 enabled: colorCheckbox.checked && root.editable visible: colorCheckbox.checked - text: colorCheckbox.checked ? attribute.value : "" + text: colorCheckbox.checked ? root.value : "" selectByMouse: true onEditingFinished: root.editingFinished( text) onAccepted: root.accepted(text) @@ -53,7 +53,7 @@ RowLayout { selectedColor: colorText.text onAccepted: { colorText.text = colorDialog.selectedColor - // Artificially trigger change of attribute value + // Artificially trigger change of value colorText.editingFinished() close() } diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/ColorHue.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/ColorHue.qml index 39db82f4e2..c4572ce52e 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeControls/ColorHue.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/ColorHue.qml @@ -4,7 +4,7 @@ import QtQuick.Layouts RowLayout { id: root - required property var attribute + required property var value property bool editable signal editingFinished(var text) signal accepted(var text) @@ -14,7 +14,7 @@ RowLayout { implicitWidth: 100 enabled: root.editable // Cast value to string to avoid intrusive scientific notations on numbers - property string displayValue: String(slider.pressed ? slider.formattedValue : attribute.value) + property string displayValue: String(slider.pressed ? slider.formattedValue : root.value) text: displayValue selectByMouse: true validator: DoubleValidator { @@ -27,7 +27,7 @@ RowLayout { Rectangle { height: slider.height width: height - color: Qt.hsla(slider.pressed ? slider.formattedValue : attribute.value, 1, 0.5, 1) + color: Qt.hsla(slider.pressed ? slider.formattedValue : root.value, 1, 0.5, 1) } Slider { id: slider @@ -35,7 +35,7 @@ RowLayout { readonly property int stepDecimalCount: 2 readonly property real formattedValue: value.toFixed(stepDecimalCount) enabled: root.editable - value: root.attribute.value + value: root.value from: 0 to: 1 stepSize: 0.01 diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/SliderField.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/SliderField.qml index 87eeb958ad..209f9ecb31 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeControls/SliderField.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/SliderField.qml @@ -6,8 +6,19 @@ import Utils RowLayout { id: root - required property var attribute + required property var keyable + required property var keyableValue + required property var fallbackValue + required property var type + required property int length + required property int start + required property int end + required property int step property bool editable + signal editingFinished(bool hasExprError, var evaluatedValue, var text, var displayValue) + signal accepted(bool hasExprError, var evaluatedValue, var text, var displayValue) + signal destruction(bool activeFocus, bool hasExprError, var text) + signal pressedChanged(bool pressed, var formattedValue) ExpressionTextField { id: expressionTextField implicitWidth: 100 @@ -15,43 +26,24 @@ RowLayout { enabled: root.editable // Cast value to string to avoid intrusive scientific notations on numbers property string displayValue: String(slider.active && slider.item.pressed ? slider.item.formattedValue : - attribute.keyable ? attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) : - attribute.value) + root.keyable + ? root.keyableValue + : root.fallbackValue) text: displayValue selectByMouse: true // Note: Use autoScroll as a workaround for alignment // When the value change keep the text align to the left to be able to read the most important part // of the number. When we are editing (item is in focus), the content should follow the editing. autoScroll: activeFocus - isInt: attribute.type === "FloatParam" ? false : true - onEditingFinished: { - if (!hasExprError) { - setTextFieldAttribute(root.attribute, expressionTextField.evaluatedValue) - // Restore binding - expressionTextField.text = Qt.binding(function() { return String(expressionTextField.displayValue); }) - } - } + isInt: root.type === "FloatParam" ? false : true + onEditingFinished: root.editingFinished(hasExprError, expressionTextField.evaluatedValue, expressionTextField.text, expressionTextField.displayValue) background: Rectangle { border.color: errorMessages.length ? "orange" : "transparent" color: Qt.darker(palette.window, 1.2) radius: 2 } - onAccepted: { - if (!hasExprError) { - setTextFieldAttribute(root.attribute, expressionTextField.evaluatedValue) - // Restore binding - expressionTextField.text = Qt.binding(function() { return String(expressionTextField.displayValue); }) - } - // When the text is too long, display the left part - // (with the most important values and cut the floating point details) - ensureVisible(0) - } - Component.onDestruction: { - if (activeFocus) { - if (!hasExprError) - setTextFieldAttribute(root.attribute, expressionTextField.evaluatedValue) - } - } + onAccepted: root.accepted(hasExprError, expressionTextField.evaluatedValue, expressionTextField.text, expressionTextField.displayValue) + Component.onDestruction: root.destruction(activeFocus, hasExprError, expressionTextField.evaluatedValue) Component.onCompleted: { // When the text is too long, display the left part // (with the most important values and cut the floating point details) @@ -61,24 +53,19 @@ RowLayout { Loader { id: slider Layout.fillWidth: true - active: attribute.desc.range.length === 3 + active: root.length === 3 sourceComponent: Slider { readonly property int stepDecimalCount: stepSize < 1 ? String(stepSize).split(".").pop().length : 0 readonly property real formattedValue: value.toFixed(stepDecimalCount) enabled: root.editable - value: attribute.keyable ? attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) : attribute.value - from: attribute.desc.range[0] - to: attribute.desc.range[1] - stepSize: attribute.desc.range[2] + value: root.keyable + ? root.keyableValue + : root.fallbackValue + from: root.start + to: root.end + stepSize: root.step snapMode: Slider.SnapAlways - onPressedChanged: { - if (!pressed) { - if (attribute.keyable) - _currentScene.addAttributeKeyValue(attribute, _currentScene.selectedViewId, formattedValue) - else - _currentScene.setAttribute(attribute, formattedValue) - } - } + onPressedChanged: root.pressedChanged(pressed, formattedValue) } } } \ No newline at end of file diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index 60182e959f..52990c5228 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -522,7 +522,7 @@ RowLayout { id: colorComponent AttributeControls.Color { id: colorControl - attribute: root.attribute + value: root.attribute.value editable: root.editable onClicked: (checked, previousColor, colorTextValue) =>{ if (checked) { @@ -586,8 +586,46 @@ RowLayout { Component { id: sliderComponent AttributeControls.SliderField { - attribute: root.attribute + keyable: root.attribute.keyable + keyableValue: root.attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) + fallbackValue: root.attribute.value + type: root.attribute.type + length: root.attribute.desc.range.length + start: root.attribute.desc.range[0] + end: root.attribute.desc.range[1] + step: root.attribute.desc.range[2] editable: root.editable + onEditingFinished: (hasExprError, evaluatedValue, text, displayValue) => { + if (!hasExprError) { + setTextFieldAttribute(root.attribute, evaluatedValue) + // Restore binding + text = Qt.binding(function() { return String(displayValue); }) + } + } + onAccepted: (hasExprError, evaluatedValue, text, displayValue) => { + if (!hasExprError) { + setTextFieldAttribute(root.attribute, evaluatedValue) + // Restore binding + text = Qt.binding(function() { return String(displayValue); }) + } + // When the text is too long, display the left part + // (with the most important values and cut the floating point details) + ensureVisible(0) + } + Component.onDestruction: (activeFocus, hasExprError, displayValue) => { + if (activeFocus) { + if (!hasExprError) + setTextFieldAttribute(root.attribute, evaluatedValue) + } + } + onPressedChanged: (pressed, formattedValue) => { + if (!pressed) { + if (root.attribute.keyable) + _currentScene.addAttributeKeyValue(root.attribute, _currentScene.selectedViewId, formattedValue) + else + _currentScene.setAttribute(root.attribute, formattedValue) + } + } } } @@ -791,7 +829,7 @@ RowLayout { Component { id: colorHueComponent AttributeControls.ColorHue { - attribute: root.attribute + value: root.attribute.value editable: root.editable onEditingFinished: (text) => setTextFieldAttribute(root.attribute, text) onAccepted: (text) => setTextFieldAttribute(root.attribute, text) From d896603c7f88baa5edd45568947147d0793fa2e0 Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Wed, 12 Aug 2026 19:36:37 +0200 Subject: [PATCH 19/26] [GraphEditor] Implemented ternary operator logic directly inside keyedValue property --- .../GraphEditor/AttributeControls/CheckBoxRow.qml | 6 +----- .../GraphEditor/AttributeControls/SliderField.qml | 13 +++---------- .../ui/qml/GraphEditor/AttributeItemDelegate.qml | 12 ++++++------ 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/CheckBoxRow.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/CheckBoxRow.qml index e12fc52a57..81453a14c7 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeControls/CheckBoxRow.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/CheckBoxRow.qml @@ -4,15 +4,11 @@ import QtQuick.Controls Row { id: root property bool editable - property bool keyable property var keyedValue - property var plainValue signal toggled() CheckBox { enabled: root.editable - checked: root.keyable - ? root.keyedValue - : root.plainValue + checked: root.keyedValue onToggled: { root.toggled() } diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/SliderField.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/SliderField.qml index 209f9ecb31..ba3f306382 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeControls/SliderField.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/SliderField.qml @@ -6,9 +6,7 @@ import Utils RowLayout { id: root - required property var keyable - required property var keyableValue - required property var fallbackValue + required property var keyedValue required property var type required property int length required property int start @@ -25,10 +23,7 @@ RowLayout { Layout.fillWidth: !slider.active enabled: root.editable // Cast value to string to avoid intrusive scientific notations on numbers - property string displayValue: String(slider.active && slider.item.pressed ? slider.item.formattedValue : - root.keyable - ? root.keyableValue - : root.fallbackValue) + property string displayValue: String(slider.active && slider.item.pressed ? slider.item.formattedValue : keyedValue) text: displayValue selectByMouse: true // Note: Use autoScroll as a workaround for alignment @@ -58,9 +53,7 @@ RowLayout { readonly property int stepDecimalCount: stepSize < 1 ? String(stepSize).split(".").pop().length : 0 readonly property real formattedValue: value.toFixed(stepDecimalCount) enabled: root.editable - value: root.keyable - ? root.keyableValue - : root.fallbackValue + value: keyedValue from: root.start to: root.end stepSize: root.step diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index 52990c5228..f6ea0d2f1c 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -586,9 +586,9 @@ RowLayout { Component { id: sliderComponent AttributeControls.SliderField { - keyable: root.attribute.keyable - keyableValue: root.attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) - fallbackValue: root.attribute.value + keyedValue: root.attribute.keyable + ? root.attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) + : root.attribute.value type: root.attribute.type length: root.attribute.desc.range.length start: root.attribute.desc.range[0] @@ -633,9 +633,9 @@ RowLayout { id: checkboxComponent AttributeControls.CheckBoxRow { editable: root.editable - keyable: root.attribute.keyable - keyedValue: attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) - plainValue: attribute.value + keyedValue: root.attribute.keyable + ? root.attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) + : root.attribute.value onToggled: { if(root.attribute.keyable) { From 42e1518954361743031529d2c5882c2c8057837c Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Wed, 12 Aug 2026 19:39:55 +0200 Subject: [PATCH 20/26] [GraphEditor] Restored root.attribute calls inside setTextFieldAttribute --- .../qml/GraphEditor/AttributeItemDelegate.qml | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index f6ea0d2f1c..eac9088bad 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -413,7 +413,7 @@ RowLayout { } } - function setTextFieldAttribute(attr, value) { + function setTextFieldAttribute(value) { // editingFinished called even when TextField is readonly if (!editable) return @@ -424,13 +424,13 @@ RowLayout { if(attribute.keyable) _currentScene.addAttributeKeyValue(root.attribute, _currentScene.selectedViewId, Number(value)) else - _currentScene.setAttribute(attr, Number(value)) + _currentScene.setAttribute(root.attribute, Number(value)) break case "File": - _currentScene.setAttribute(attr, value) + _currentScene.setAttribute(root.attribute, value) break default: - _currentScene.setAttribute(attr, value.trim()) + _currentScene.setAttribute(root.attribute, value.trim()) break } } @@ -539,11 +539,11 @@ RowLayout { _currentScene.setAttribute(root.attribute, "") } } - onEditingFinished: (text) => setTextFieldAttribute(root.attribute, text) - onAccepted: (text) => setTextFieldAttribute(root.attribute, text) + onEditingFinished: (text) => setTextFieldAttribute(text) + onAccepted: (text) => setTextFieldAttribute(text) onDestruction: (activeFocus, text) => { if (activeFocus) - setTextFieldAttribute(root.attribute, text) + setTextFieldAttribute(text) } } } @@ -597,14 +597,14 @@ RowLayout { editable: root.editable onEditingFinished: (hasExprError, evaluatedValue, text, displayValue) => { if (!hasExprError) { - setTextFieldAttribute(root.attribute, evaluatedValue) + setTextFieldAttribute(evaluatedValue) // Restore binding text = Qt.binding(function() { return String(displayValue); }) } } onAccepted: (hasExprError, evaluatedValue, text, displayValue) => { if (!hasExprError) { - setTextFieldAttribute(root.attribute, evaluatedValue) + setTextFieldAttribute(evaluatedValue) // Restore binding text = Qt.binding(function() { return String(displayValue); }) } @@ -615,7 +615,7 @@ RowLayout { Component.onDestruction: (activeFocus, hasExprError, displayValue) => { if (activeFocus) { if (!hasExprError) - setTextFieldAttribute(root.attribute, evaluatedValue) + setTextFieldAttribute(evaluatedValue) } } onPressedChanged: (pressed, formattedValue) => { @@ -831,11 +831,11 @@ RowLayout { AttributeControls.ColorHue { value: root.attribute.value editable: root.editable - onEditingFinished: (text) => setTextFieldAttribute(root.attribute, text) - onAccepted: (text) => setTextFieldAttribute(root.attribute, text) + onEditingFinished: (text) => setTextFieldAttribute(text) + onAccepted: (text) => setTextFieldAttribute(text) onDestruction: (activeFocus, text) => { if (activeFocus) - setTextFieldAttribute(root.attribute, text) + setTextFieldAttribute(text) } onPressedChanged: (pressed, formattedValue) => { if (!pressed) From 7ae0a0796575cc1a41d76eda0a400f71b37beefc Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Thu, 13 Aug 2026 09:38:34 +0200 Subject: [PATCH 21/26] [GraphEditor] Removed the pushbutton separated component --- .../ui/qml/GraphEditor/AttributeControls/PushButton.qml | 8 -------- meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml | 4 ++-- 2 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 meshroom/ui/qml/GraphEditor/AttributeControls/PushButton.qml diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/PushButton.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/PushButton.qml deleted file mode 100644 index 54bb47c93f..0000000000 --- a/meshroom/ui/qml/GraphEditor/AttributeControls/PushButton.qml +++ /dev/null @@ -1,8 +0,0 @@ -import QtQuick -import QtQuick.Controls - -Button { - id: root - required property string label - text: label -} \ No newline at end of file diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index eac9088bad..ebfb1fe88f 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -483,8 +483,8 @@ RowLayout { Component { id: pushButtonComponent - AttributeControls.PushButton { - label: attribute.label + Button { + text: attribute.label enabled: root.editable onClicked: { attribute.clicked() From 3d8549b32a8835f7baeb679ec2fab138a5f9802b Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Fri, 14 Aug 2026 12:47:49 +0200 Subject: [PATCH 22/26] [GraphEditor] Fixed textComponents errors, and added backup values to slider component --- .../AttributeControls/SliderField.qml | 7 +++- .../AttributeControls/TextAreaFlick.qml | 18 +++------ .../AttributeControls/TextFieldRow.qml | 26 +++++-------- .../qml/GraphEditor/AttributeItemDelegate.qml | 37 +++++++++++++++---- 4 files changed, 51 insertions(+), 37 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/SliderField.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/SliderField.qml index ba3f306382..5435af1f48 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeControls/SliderField.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/SliderField.qml @@ -37,7 +37,12 @@ RowLayout { color: Qt.darker(palette.window, 1.2) radius: 2 } - onAccepted: root.accepted(hasExprError, expressionTextField.evaluatedValue, expressionTextField.text, expressionTextField.displayValue) + onAccepted: { + root.accepted(hasExprError, expressionTextField.evaluatedValue, expressionTextField.text, expressionTextField.displayValue) + // When the text is too long, display the left part + // (with the most important values and cut the floating point details) + ensureVisible(0) + } Component.onDestruction: root.destruction(activeFocus, hasExprError, expressionTextField.evaluatedValue) Component.onCompleted: { // When the text is too long, display the left part diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/TextAreaFlick.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/TextAreaFlick.qml index c6e6271f31..2cc4146e29 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeControls/TextAreaFlick.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/TextAreaFlick.qml @@ -9,7 +9,9 @@ Rectangle { required property var attribute property bool isLarge property bool editable - + signal editingFinished(var text) + signal destruction(bool activeFocus, var text) + signal dropped(bool hasUrls, bool hasText, var urlText, var text) // Fixed background for the flickable object color: palette.base width: parent.width @@ -27,7 +29,7 @@ Rectangle { bottomPadding: 2 topPadding: 2 readOnly: !root.editable - onEditingFinished: setTextFieldAttribute(root.attribute, text) + onEditingFinished: root.editingFinished(text) text: root.label selectByMouse: true background: Rectangle { @@ -39,19 +41,11 @@ Rectangle { onPressed: { root.forceActiveFocus() } - Component.onDestruction: { - if (activeFocus) - setTextFieldAttribute(root.attribute, text) - } + Component.onDestruction: root.destruction(activeFocus, text) DropArea { enabled: root.editable anchors.fill: parent - onDropped: { - if (drop.hasUrls) - setTextFieldAttribute(root.attribute, Filepath.urlToString(drop.urls[0])) - else if (drop.hasText && drop.text != '') - setTextFieldAttribute(root.attribute, drop.text) - } + onDropped: (drop) => root.dropped(drop.hasUrls, drop.hasText && drop.text != '', Filepath.urlToString(drop.urls[0]), drop.text) } } } diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/TextFieldRow.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/TextFieldRow.qml index 47fe5770ed..53429cd00c 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeControls/TextFieldRow.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/TextFieldRow.qml @@ -8,6 +8,10 @@ RowLayout { required property bool mandatory required property var attribute property bool editable + signal editingFinished(var text) + signal accepted(var parameterLabel, var text) + signal destruction(bool activeFocus, var text) + signal dropped(bool hasUrls, bool hasText, var urlText, var text) anchors.fill: parent TextField { id: textField @@ -38,32 +42,20 @@ RowLayout { ] selectByMouse: true persistentSelection: false - onEditingFinished: { - setTextFieldAttribute(root.attribute, text) - } - onAccepted: { - setTextFieldAttribute(root.attribute, text) - parameterLabel.forceActiveFocus() - } + onEditingFinished: root.editingFinished(text) + + onAccepted: root.accepted(parameterLabel, text) Keys.onPressed: function(event) { if ((event.key == Qt.Key_Escape)) { event.accepted = true parameterLabel.forceActiveFocus() } } - Component.onDestruction: { - if (activeFocus) - setTextFieldAttribute(root.attribute, text) - } + Component.onDestruction: root.destruction(activeFocus, text) DropArea { enabled: root.editable anchors.fill: parent - onDropped: function(drop) { - if (drop.hasUrls) - setTextFieldAttribute(root.attribute, Filepath.urlToString(drop.urls[0])) - else if (drop.hasText && drop.text != '') - setTextFieldAttribute(root.attribute, drop.text) - } + onDropped: (drop) => root.dropped(drop.hasUrls, drop.hasText && drop.text != '', Filepath.urlToString(drop.urls[0]), drop.text) } onPressed: (event) => { if (event.button == Qt.RightButton) { diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index ebfb1fe88f..9c133b96ad 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -505,6 +505,21 @@ RowLayout { mandatory: attribute.isMandatory attribute: root.attribute editable: root.editable + onEditingFinished: (text) => setTextFieldAttribute(root.attribute, text) + onAccepted: (parameterLabel, text) => { + setTextFieldAttribute(root.attribute, text) + parameterLabel.forceActiveFocus() + } + onDestruction: (activeFocus, text) => { + if (activeFocus) + setTextFieldAttribute(root.attribute, text) + } + onDropped: (hasUrls, hasText, urlText, text) => { + if (hasUrls) + setTextFieldAttribute(root.attribute, urlText) + else if (hasText) + setTextFieldAttribute(root.attribute, text) + } } } @@ -515,6 +530,17 @@ RowLayout { isLarge: attribute.desc.semantic.includes("large") attribute: root.attribute editable: root.editable + onEditingFinished: (text) => setTextFieldAttribute(root.attribute, text) + onDestruction: (activeFocus, text) => { + if (activeFocus) + setTextFieldAttribute(root.attribute, text) + } + onDropped: (hasUrls, hasText, urlText, text) => { + if (hasUrls) + setTextFieldAttribute(root.attribute, urlText) + else if (hasText) + setTextFieldAttribute(root.attribute, text) + } } } @@ -590,10 +616,10 @@ RowLayout { ? root.attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) : root.attribute.value type: root.attribute.type - length: root.attribute.desc.range.length - start: root.attribute.desc.range[0] - end: root.attribute.desc.range[1] - step: root.attribute.desc.range[2] + length: root.attribute.desc.range ? root.attribute.desc.range.length : 0 + start: root.attribute.desc.range ? root.attribute.desc.range[0] : 0 + end: root.attribute.desc.range ? root.attribute.desc.range[1] : 0 + step: root.attribute.desc.range ? root.attribute.desc.range[2] : 0 editable: root.editable onEditingFinished: (hasExprError, evaluatedValue, text, displayValue) => { if (!hasExprError) { @@ -608,9 +634,6 @@ RowLayout { // Restore binding text = Qt.binding(function() { return String(displayValue); }) } - // When the text is too long, display the left part - // (with the most important values and cut the floating point details) - ensureVisible(0) } Component.onDestruction: (activeFocus, hasExprError, displayValue) => { if (activeFocus) { From c64e6f5706bd90697ab93ac83360e786f4abcb37 Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Fri, 14 Aug 2026 14:35:47 +0200 Subject: [PATCH 23/26] [GraphEditor] Externalised texfield toggle logic, and slider also handles undefined values --- .../AttributeControls/TextAreaFlick.qml | 1 - .../AttributeControls/TextFieldRow.qml | 8 ++------ .../qml/GraphEditor/AttributeItemDelegate.qml | 17 ++++++++++++----- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/TextAreaFlick.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/TextAreaFlick.qml index 2cc4146e29..84ca002ffe 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeControls/TextAreaFlick.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/TextAreaFlick.qml @@ -6,7 +6,6 @@ import Controls Rectangle { id: root required property string label - required property var attribute property bool isLarge property bool editable signal editingFinished(var text) diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/TextFieldRow.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/TextFieldRow.qml index 53429cd00c..66db6a911a 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeControls/TextFieldRow.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/TextFieldRow.qml @@ -12,6 +12,7 @@ RowLayout { signal accepted(var parameterLabel, var text) signal destruction(bool activeFocus, var text) signal dropped(bool hasUrls, bool hasText, var urlText, var text) + signal triggered(var text, int start, int end, int length, var clipboard) anchors.fill: parent TextField { id: textField @@ -105,12 +106,7 @@ RowLayout { if (clipboardText.length === 0) { return } - const before = textField.text.substr(0, textField.selectionStart) - const after = textField.text.substr(textField.selectionEnd, textField.text.length) - const updatedValue = before + clipboardText + after - setTextFieldAttribute(root.attribute, updatedValue) - // Set the cursor at the end of the added text - textField.cursorPosition = before.length + clipboardText.length + triggered(textField.text, textField.selectionStart, textField.selectionEnd, textField.text.length, clipboardText) } } } diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index 9c133b96ad..15587a0dac 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -520,6 +520,14 @@ RowLayout { else if (hasText) setTextFieldAttribute(root.attribute, text) } + onTriggered: (text, start, end, length, clipboard) => { + const before = text.substr(0, start) + const after = text.substr(end, length) + const updatedValue = before + clipboardText + after + setTextFieldAttribute(root.attribute, updatedValue) + // Set the cursor at the end of the added text + textField.cursorPosition = before.length + clipboard.length + } } } @@ -528,7 +536,6 @@ RowLayout { AttributeControls.TextAreaFlick { label: attribute.value isLarge: attribute.desc.semantic.includes("large") - attribute: root.attribute editable: root.editable onEditingFinished: (text) => setTextFieldAttribute(root.attribute, text) onDestruction: (activeFocus, text) => { @@ -616,10 +623,10 @@ RowLayout { ? root.attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) : root.attribute.value type: root.attribute.type - length: root.attribute.desc.range ? root.attribute.desc.range.length : 0 - start: root.attribute.desc.range ? root.attribute.desc.range[0] : 0 - end: root.attribute.desc.range ? root.attribute.desc.range[1] : 0 - step: root.attribute.desc.range ? root.attribute.desc.range[2] : 0 + length: (root.attribute.desc.range && root.attribute.desc.range.length) || 0 + start: (root.attribute.desc.range && root.attribute.desc.range[0]) || 0 + end: (root.attribute.desc.range && root.attribute.desc.range[1]) || 0 + step: (root.attribute.desc.range && root.attribute.desc.range[2]) || 0 editable: root.editable onEditingFinished: (hasExprError, evaluatedValue, text, displayValue) => { if (!hasExprError) { From 0ccb365c9d97f1bb96a76fac31c9c25e1050ae77 Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Fri, 14 Aug 2026 14:41:17 +0200 Subject: [PATCH 24/26] [GraphEditor] Fixed invalid number of arguments in setTextFieldAttribute --- .../qml/GraphEditor/AttributeItemDelegate.qml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index 15587a0dac..6116d665e8 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -505,26 +505,26 @@ RowLayout { mandatory: attribute.isMandatory attribute: root.attribute editable: root.editable - onEditingFinished: (text) => setTextFieldAttribute(root.attribute, text) + onEditingFinished: (text) => setTextFieldAttribute(text) onAccepted: (parameterLabel, text) => { - setTextFieldAttribute(root.attribute, text) + setTextFieldAttribute(text) parameterLabel.forceActiveFocus() } onDestruction: (activeFocus, text) => { if (activeFocus) - setTextFieldAttribute(root.attribute, text) + setTextFieldAttribute(text) } onDropped: (hasUrls, hasText, urlText, text) => { if (hasUrls) - setTextFieldAttribute(root.attribute, urlText) + setTextFieldAttribute(urlText) else if (hasText) - setTextFieldAttribute(root.attribute, text) + setTextFieldAttribute(text) } onTriggered: (text, start, end, length, clipboard) => { const before = text.substr(0, start) const after = text.substr(end, length) const updatedValue = before + clipboardText + after - setTextFieldAttribute(root.attribute, updatedValue) + setTextFieldAttribute(updatedValue) // Set the cursor at the end of the added text textField.cursorPosition = before.length + clipboard.length } @@ -537,16 +537,16 @@ RowLayout { label: attribute.value isLarge: attribute.desc.semantic.includes("large") editable: root.editable - onEditingFinished: (text) => setTextFieldAttribute(root.attribute, text) + onEditingFinished: (text) => setTextFieldAttribute(text) onDestruction: (activeFocus, text) => { if (activeFocus) - setTextFieldAttribute(root.attribute, text) + setTextFieldAttribute(text) } onDropped: (hasUrls, hasText, urlText, text) => { if (hasUrls) - setTextFieldAttribute(root.attribute, urlText) + setTextFieldAttribute(urlText) else if (hasText) - setTextFieldAttribute(root.attribute, text) + setTextFieldAttribute(text) } } } From 3d0f22279c3b6f6f17b58d5125bd8496a434a260 Mon Sep 17 00:00:00 2001 From: raphaelKoskas <64128722+raphaelKoskas@users.noreply.github.com> Date: Tue, 18 Aug 2026 15:32:47 +0200 Subject: [PATCH 25/26] [GraphEditor] Changed variable name inside CheckBoxRow.qml --- meshroom/ui/qml/GraphEditor/AttributeControls/CheckBoxRow.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/CheckBoxRow.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/CheckBoxRow.qml index 81453a14c7..f65d23c816 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeControls/CheckBoxRow.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/CheckBoxRow.qml @@ -4,11 +4,11 @@ import QtQuick.Controls Row { id: root property bool editable - property var keyedValue + property var checked signal toggled() CheckBox { enabled: root.editable - checked: root.keyedValue + checked: root.checked onToggled: { root.toggled() } From 27772a95bd31b259715fe048b55e37ff143b4091 Mon Sep 17 00:00:00 2001 From: koskasdediegor Date: Wed, 19 Aug 2026 12:58:03 +0200 Subject: [PATCH 26/26] [GraphEditor] Changed variable name inside SliderField.qml --- .../ui/qml/GraphEditor/AttributeControls/SliderField.qml | 6 +++--- meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/AttributeControls/SliderField.qml b/meshroom/ui/qml/GraphEditor/AttributeControls/SliderField.qml index 5435af1f48..ab87290f92 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeControls/SliderField.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeControls/SliderField.qml @@ -6,7 +6,7 @@ import Utils RowLayout { id: root - required property var keyedValue + required property var checked required property var type required property int length required property int start @@ -23,7 +23,7 @@ RowLayout { Layout.fillWidth: !slider.active enabled: root.editable // Cast value to string to avoid intrusive scientific notations on numbers - property string displayValue: String(slider.active && slider.item.pressed ? slider.item.formattedValue : keyedValue) + property string displayValue: String(slider.active && slider.item.pressed ? slider.item.formattedValue : checked) text: displayValue selectByMouse: true // Note: Use autoScroll as a workaround for alignment @@ -58,7 +58,7 @@ RowLayout { readonly property int stepDecimalCount: stepSize < 1 ? String(stepSize).split(".").pop().length : 0 readonly property real formattedValue: value.toFixed(stepDecimalCount) enabled: root.editable - value: keyedValue + value: root.checked from: root.start to: root.end stepSize: root.step diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index 6116d665e8..e50d2308c2 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -619,7 +619,7 @@ RowLayout { Component { id: sliderComponent AttributeControls.SliderField { - keyedValue: root.attribute.keyable + checked: root.attribute.keyable ? root.attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) : root.attribute.value type: root.attribute.type @@ -663,7 +663,7 @@ RowLayout { id: checkboxComponent AttributeControls.CheckBoxRow { editable: root.editable - keyedValue: root.attribute.keyable + checked: root.attribute.keyable ? root.attribute.keyValues.getValueAtKeyOrDefault(_currentScene.selectedViewId) : root.attribute.value onToggled: {