EffectComposer: Fix channel property saving

Channel properties were saved as regular int properties to .qep files,
making the property control incorrect once you reopened it in effect
composer.

Fixes: QDS-12835
Change-Id: I833763f385e64420bc5f1a1da9266869e739d3be
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Miikka Heikkinen
2024-05-27 12:22:08 +03:00
parent 72b3f2a090
commit 1cd3667dce

View File

@@ -518,11 +518,9 @@ QJsonObject nodeToJson(const CompositionNode &node)
uniformObject.insert("type", type);
if (uniform->type() == Uniform::Type::Define || uniform->type() == Uniform::Type::Channel) {
QString controlType = Uniform::stringFromType(uniform->controlType());
if (controlType != type)
uniformObject.insert("controlType", controlType);
}
if (!uniform->displayName().isEmpty())
uniformObject.insert("displayName", QString(uniform->displayName()));
@@ -544,7 +542,8 @@ QJsonObject nodeToJson(const CompositionNode &node)
if (!uniform->description().isEmpty())
uniformObject.insert("description", uniform->description());
if (uniform->type() == Uniform::Type::Float
|| uniform->type() == Uniform::Type::Int
|| (uniform->type() == Uniform::Type::Int
&& uniform->controlType() != Uniform::Type::Channel)
|| uniform->type() == Uniform::Type::Vec2
|| uniform->type() == Uniform::Type::Vec3
|| uniform->type() == Uniform::Type::Vec4