QmlDesigner: Fix issues related to uniforms

Some types were parsed wrong for shader values

Change-Id: I4301d671dfa7bde1f23feacd64ceb5f0f9d247b9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Amr Essam
2023-10-26 17:41:54 +03:00
committed by Amr Elsayed
parent 37f00b47a9
commit 2473265541
3 changed files with 6 additions and 6 deletions

View File

@@ -230,7 +230,7 @@ const QString EffectMakerModel::getBufUniform()
for (const auto uniform : uniforms) {
// TODO: Check if uniform is already added.
if (uniform->type() != Uniform::Type::Sampler && uniform->type() != Uniform::Type::Define) {
QString type = Uniform::stringFromType(uniform->type());
QString type = Uniform::stringFromType(uniform->type(), true);
QString props = " " + type + " " + uniform->name() + ";\n";
s += props;
}
@@ -480,7 +480,7 @@ const QString EffectMakerModel::getConstVariables()
for (Uniform *uniform : uniforms) {
// TODO: Check if uniform is already added.
QString constValue = valueAsVariable(*uniform);
QString type = Uniform::stringFromType(uniform->type());
QString type = Uniform::stringFromType(uniform->type(), true);
s += QString("const %1 %2 = %3;\n").arg(type, uniform->name(), constValue);
}
if (!s.isEmpty())