forked from qt-creator/qt-creator
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:
@@ -518,11 +518,9 @@ QJsonObject nodeToJson(const CompositionNode &node)
|
|||||||
|
|
||||||
uniformObject.insert("type", type);
|
uniformObject.insert("type", type);
|
||||||
|
|
||||||
if (uniform->type() == Uniform::Type::Define || uniform->type() == Uniform::Type::Channel) {
|
QString controlType = Uniform::stringFromType(uniform->controlType());
|
||||||
QString controlType = Uniform::stringFromType(uniform->controlType());
|
if (controlType != type)
|
||||||
if (controlType != type)
|
uniformObject.insert("controlType", controlType);
|
||||||
uniformObject.insert("controlType", controlType);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!uniform->displayName().isEmpty())
|
if (!uniform->displayName().isEmpty())
|
||||||
uniformObject.insert("displayName", QString(uniform->displayName()));
|
uniformObject.insert("displayName", QString(uniform->displayName()));
|
||||||
@@ -544,7 +542,8 @@ QJsonObject nodeToJson(const CompositionNode &node)
|
|||||||
if (!uniform->description().isEmpty())
|
if (!uniform->description().isEmpty())
|
||||||
uniformObject.insert("description", uniform->description());
|
uniformObject.insert("description", uniform->description());
|
||||||
if (uniform->type() == Uniform::Type::Float
|
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::Vec2
|
||||||
|| uniform->type() == Uniform::Type::Vec3
|
|| uniform->type() == Uniform::Type::Vec3
|
||||||
|| uniform->type() == Uniform::Type::Vec4
|
|| uniform->type() == Uniform::Type::Vec4
|
||||||
|
Reference in New Issue
Block a user