2023-08-18 15:39:40 +03:00
|
|
|
// 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 "effectutils.h"
|
|
|
|
|
|
2023-12-07 18:32:55 +02:00
|
|
|
#include <coreplugin/icore.h>
|
|
|
|
|
|
2023-08-18 15:39:40 +03:00
|
|
|
#include <QJsonArray>
|
|
|
|
|
|
2024-01-26 14:55:50 +02:00
|
|
|
namespace EffectComposer {
|
2023-08-18 15:39:40 +03:00
|
|
|
|
|
|
|
|
QString EffectUtils::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;
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-07 18:32:55 +02:00
|
|
|
QString EffectUtils::nodesSourcesPath()
|
|
|
|
|
{
|
|
|
|
|
#ifdef SHARE_QML_PATH
|
|
|
|
|
if (Utils::qtcEnvironmentVariableIsSet("LOAD_QML_FROM_SOURCE"))
|
2024-01-26 14:55:50 +02:00
|
|
|
return QLatin1String(SHARE_QML_PATH) + "/effectComposerNodes";
|
2023-12-07 18:32:55 +02:00
|
|
|
#endif
|
2024-01-26 14:55:50 +02:00
|
|
|
return Core::ICore::resourcePath("qmldesigner/effectComposerNodes").toString();
|
2023-12-07 18:32:55 +02:00
|
|
|
}
|
|
|
|
|
|
2024-01-26 14:55:50 +02:00
|
|
|
} // namespace EffectComposer
|