Fix texture node

Texture node displays data correctly

Change-Id: I075230d2640be7a832c4e4cbdf798aa5148e7267
Reviewed-by: spyro-adb <adb@spyro-soft.com>
This commit is contained in:
Andrzej Biniek
2024-12-26 22:31:49 +01:00
committed by spyro-adb
parent 1c64cff458
commit 5e2723581d
2 changed files with 18 additions and 7 deletions

View File

@@ -12,11 +12,7 @@ Base {
id: root
property QtObject value: QtObject {
property url text: `image://qmldesigner_nodegrapheditor/${comboBox.currentValue}`
onTextChanged: {
NodeGraphEditorBackend.nodeGraphEditorModel.hasUnsavedChanges = true;
}
property url text: `image://qmldesigner_nodegrapheditor/${comboBox.currentValue}`
}
Layout.preferredWidth: 175
@@ -53,7 +49,10 @@ Base {
model: fileModel.model
textRole: "fileName"
valueRole: "relativeFilePath"
onCurrentValueChanged: {
NodeGraphEditorBackend.nodeGraphEditorModel.hasUnsavedChanges = true;
root.value.text = `image://qmldesigner_nodegrapheditor/${currentValue}`
}
// valueRole: "absoluteFilePath"
// model: [

View File

@@ -15,6 +15,7 @@ Base {
readonly property QtQuick3D.Texture reset: QtQuick3D.Texture {
}
property alias source: root.value.source
readonly property QtQuick3D.Texture value: QtQuick3D.Texture {
}
@@ -22,6 +23,18 @@ Base {
Layout.preferredWidth: 150
type: "Texture"
portsMetaData: QtObject {
property var pin: [
{
id: "texture_in_source",
alias: "source",
name: "Source",
type: "QUrl"
},
]
property var pout: []
}
Component.onCompleted: {
node.label = "Texture";
internal.configurePorts(root.graph);
@@ -34,7 +47,6 @@ Base {
anchors.centerIn: parent
height: 96
source: root.value.source
// source: `image://qmldesigner_nodegrapheditor/${root.value.source}`
width: 96
}