forked from qt-creator/qt-creator
Fix texture node
Texture node displays data correctly Change-Id: I075230d2640be7a832c4e4cbdf798aa5148e7267 Reviewed-by: spyro-adb <adb@spyro-soft.com>
This commit is contained in:
committed by
spyro-adb
parent
1c64cff458
commit
5e2723581d
@@ -12,11 +12,7 @@ Base {
|
|||||||
id: root
|
id: root
|
||||||
|
|
||||||
property QtObject value: QtObject {
|
property QtObject value: QtObject {
|
||||||
property url text: `image://qmldesigner_nodegrapheditor/${comboBox.currentValue}`
|
property url text: `image://qmldesigner_nodegrapheditor/${comboBox.currentValue}`
|
||||||
|
|
||||||
onTextChanged: {
|
|
||||||
NodeGraphEditorBackend.nodeGraphEditorModel.hasUnsavedChanges = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Layout.preferredWidth: 175
|
Layout.preferredWidth: 175
|
||||||
@@ -53,7 +49,10 @@ Base {
|
|||||||
model: fileModel.model
|
model: fileModel.model
|
||||||
textRole: "fileName"
|
textRole: "fileName"
|
||||||
valueRole: "relativeFilePath"
|
valueRole: "relativeFilePath"
|
||||||
|
onCurrentValueChanged: {
|
||||||
|
NodeGraphEditorBackend.nodeGraphEditorModel.hasUnsavedChanges = true;
|
||||||
|
root.value.text = `image://qmldesigner_nodegrapheditor/${currentValue}`
|
||||||
|
}
|
||||||
// valueRole: "absoluteFilePath"
|
// valueRole: "absoluteFilePath"
|
||||||
|
|
||||||
// model: [
|
// model: [
|
||||||
|
@@ -15,6 +15,7 @@ Base {
|
|||||||
|
|
||||||
readonly property QtQuick3D.Texture reset: QtQuick3D.Texture {
|
readonly property QtQuick3D.Texture reset: QtQuick3D.Texture {
|
||||||
}
|
}
|
||||||
|
property alias source: root.value.source
|
||||||
readonly property QtQuick3D.Texture value: QtQuick3D.Texture {
|
readonly property QtQuick3D.Texture value: QtQuick3D.Texture {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -22,6 +23,18 @@ Base {
|
|||||||
Layout.preferredWidth: 150
|
Layout.preferredWidth: 150
|
||||||
type: "Texture"
|
type: "Texture"
|
||||||
|
|
||||||
|
portsMetaData: QtObject {
|
||||||
|
property var pin: [
|
||||||
|
{
|
||||||
|
id: "texture_in_source",
|
||||||
|
alias: "source",
|
||||||
|
name: "Source",
|
||||||
|
type: "QUrl"
|
||||||
|
},
|
||||||
|
]
|
||||||
|
property var pout: []
|
||||||
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
node.label = "Texture";
|
node.label = "Texture";
|
||||||
internal.configurePorts(root.graph);
|
internal.configurePorts(root.graph);
|
||||||
@@ -34,7 +47,6 @@ Base {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
height: 96
|
height: 96
|
||||||
source: root.value.source
|
source: root.value.source
|
||||||
// source: `image://qmldesigner_nodegrapheditor/${root.value.source}`
|
|
||||||
width: 96
|
width: 96
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user