diff --git a/share/qtcreator/qmldesigner/effectMakerQmlSources/EffectCompositionNodeUniform.qml b/share/qtcreator/qmldesigner/effectMakerQmlSources/EffectCompositionNodeUniform.qml index 7c632730ccb..978fd95358c 100644 --- a/share/qtcreator/qmldesigner/effectMakerQmlSources/EffectCompositionNodeUniform.qml +++ b/share/qtcreator/qmldesigner/effectMakerQmlSources/EffectCompositionNodeUniform.qml @@ -28,7 +28,7 @@ Item { valueLoader.source = "ValueBool.qml" else if (uniformType === "color") valueLoader.source = "ValueColor.qml" - else if (uniformType === "image") + else if (uniformType === "sampler2D") valueLoader.source = "ValueImage.qml" else if (uniformType === "define") valueLoader.source = "ValueDefine.qml" diff --git a/src/plugins/effectmakernew/effectmakermodel.cpp b/src/plugins/effectmakernew/effectmakermodel.cpp index e3d8017d01f..1cdbcf94efb 100644 --- a/src/plugins/effectmakernew/effectmakermodel.cpp +++ b/src/plugins/effectmakernew/effectmakermodel.cpp @@ -774,7 +774,7 @@ void EffectMakerModel::updateCustomUniforms() for (Uniform *uniform : uniforms) { // TODO: Check if uniform is already added. const bool isDefine = uniform->type() == Uniform::Type::Define; - QString type = Uniform::typeToProperty(uniform->type()); + QString propertyType = Uniform::typeToProperty(uniform->type()); QString value = valueAsString(*uniform); QString bindedValue = valueAsBinding(*uniform); // When user has set custom uniform value, use it as-is @@ -799,7 +799,7 @@ void EffectMakerModel::updateCustomUniforms() QString boundValueString = bindedValue.isEmpty() ? QString() : QString(": %1").arg(bindedValue); // Custom values are not readonly, others inside the effect can be QString readOnly = uniform->useCustomValue() ? QString() : QStringLiteral("readonly "); - previewEffectPropertiesString += " " + readOnly + "property " + type + " " + previewEffectPropertiesString += " " + readOnly + "property " + propertyType + " " + propertyName + boundValueString + '\n'; // Define type properties are not added into exports if (!isDefine) { @@ -811,11 +811,11 @@ void EffectMakerModel::updateCustomUniforms() exportedEffectPropertiesString += QStringLiteral(" // ") + line + '\n'; } exportedEffectPropertiesString += QStringLiteral(" ") + readOnly - + "property " + type + " " + propertyName + + "property " + propertyType + " " + propertyName + boundValueString + '\n'; } else { // Custom values are not added into root - exportedRootPropertiesString += " property " + type + " " + propertyName + exportedRootPropertiesString += " property " + propertyType + " " + propertyName + valueString + '\n'; exportedEffectPropertiesString += QStringLiteral(" ") + readOnly + "property alias " + propertyName diff --git a/src/plugins/effectmakernew/uniform.cpp b/src/plugins/effectmakernew/uniform.cpp index d658383eeea..631421bc53b 100644 --- a/src/plugins/effectmakernew/uniform.cpp +++ b/src/plugins/effectmakernew/uniform.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2023 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "uniform.h" @@ -270,8 +270,10 @@ QString Uniform::stringFromType(Uniform::Type type) return "vec2"; else if (type == Type::Vec3) return "vec3"; - else if (type == Type::Vec4 || type == Type::Color) + else if (type == Type::Vec4) return "vec4"; + else if (type == Type::Color) + return "color"; else if (type == Type::Sampler) return "sampler2D"; else if (type == Type::Define)