forked from qt-creator/qt-creator
QmlDesigner: Set Uniform properties
Setting properties with some support functionality ready for UI binding Change-Id: I9636435c3ddeac74b2dbeec826571abeb4247350 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "compositionnode.h"
|
||||
|
||||
#include "effectutils.h"
|
||||
#include "uniform.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
@@ -64,10 +65,10 @@ void CompositionNode::parse(const QString &qenPath)
|
||||
return;
|
||||
}
|
||||
|
||||
m_name = json.value("name").toString(); //TODO: there is a difference between name and type
|
||||
m_name = json.value("name").toString();
|
||||
m_description = json.value("description").toString();
|
||||
m_fragmentCode = codeFromJsonArray(json.value("fragmentCode").toArray());
|
||||
m_vertexCode = codeFromJsonArray(json.value("vertexCode").toArray());
|
||||
m_fragmentCode = EffectUtils::codeFromJsonArray(json.value("fragmentCode").toArray());
|
||||
m_vertexCode = EffectUtils::codeFromJsonArray(json.value("vertexCode").toArray());
|
||||
|
||||
// parse properties
|
||||
QJsonArray properties = json.value("properties").toArray();
|
||||
@@ -84,17 +85,4 @@ void CompositionNode::parse(const QString &qenPath)
|
||||
}
|
||||
}
|
||||
|
||||
QString CompositionNode::codeFromJsonArray(const QJsonArray &codeArray)
|
||||
{
|
||||
if (codeArray.isEmpty())
|
||||
return {};
|
||||
|
||||
QString codeString;
|
||||
for (const auto &element : codeArray)
|
||||
codeString += element.toString() + '\n';
|
||||
|
||||
codeString.chop(1); // Remove last '\n'
|
||||
return codeString;
|
||||
}
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
||||
Reference in New Issue
Block a user