mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Qt6 support (#1363)
* Initial Qt6 config * Change Package order to reingfence missing packages * Update to QT 6.2.0 * Qt 6.2.0 updates * macOS fix * Simplify handling QT5 & Qt6 in parallel * Updates for Windows * Fix macos build * macOS linker fix * General support of QTDIR, update docu * MaxOS add default qt directories * Fix merge typo * Update default CMakeSettings.json with installation path options * Add additional libs required by Qt6 to CompileHowTo * Fix Qt5 items Co-authored-by: Paulchen-Panther <16664240+Paulchen-Panther@users.noreply.github.com>
This commit is contained in:
@@ -36,8 +36,8 @@ add_library(effectengine
|
||||
target_link_libraries(effectengine
|
||||
hyperion
|
||||
python
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
Qt${QT_VERSION_MAJOR}::Gui
|
||||
)
|
||||
|
||||
if (NOT CMAKE_VERSION VERSION_LESS "3.12")
|
||||
|
@@ -10,28 +10,6 @@
|
||||
#include <QMap>
|
||||
#include <QByteArray>
|
||||
|
||||
// createEffect helper
|
||||
struct find_schema : std::unary_function<EffectSchema, bool>
|
||||
{
|
||||
QString pyFile;
|
||||
find_schema(QString pyFile) :pyFile(std::move(pyFile)) { }
|
||||
bool operator()(EffectSchema const& schema) const
|
||||
{
|
||||
return schema.pyFile == pyFile;
|
||||
}
|
||||
};
|
||||
|
||||
// deleteEffect helper
|
||||
struct find_effect : std::unary_function<EffectDefinition, bool>
|
||||
{
|
||||
QString effectName;
|
||||
find_effect(QString effectName) :effectName(std::move(effectName)) { }
|
||||
bool operator()(EffectDefinition const& effectDefinition) const
|
||||
{
|
||||
return effectDefinition.name == effectName;
|
||||
}
|
||||
};
|
||||
|
||||
EffectFileHandler* EffectFileHandler::efhInstance;
|
||||
|
||||
EffectFileHandler::EffectFileHandler(const QString& rootPath, const QJsonDocument& effectConfig, QObject* parent)
|
||||
@@ -61,7 +39,9 @@ QString EffectFileHandler::deleteEffect(const QString& effectName)
|
||||
{
|
||||
QString resultMsg;
|
||||
std::list<EffectDefinition> effectsDefinition = getEffects();
|
||||
std::list<EffectDefinition>::iterator it = std::find_if(effectsDefinition.begin(), effectsDefinition.end(), find_effect(effectName));
|
||||
std::list<EffectDefinition>::iterator it = std::find_if(effectsDefinition.begin(), effectsDefinition.end(),
|
||||
[&effectName](const EffectDefinition& effectDefinition) {return effectDefinition.name == effectName; }
|
||||
);
|
||||
|
||||
if (it != effectsDefinition.end())
|
||||
{
|
||||
@@ -117,7 +97,9 @@ QString EffectFileHandler::saveEffect(const QJsonObject& message)
|
||||
QString scriptName = message["script"].toString();
|
||||
|
||||
std::list<EffectSchema> effectsSchemas = getEffectSchemas();
|
||||
std::list<EffectSchema>::iterator it = std::find_if(effectsSchemas.begin(), effectsSchemas.end(), find_schema(scriptName));
|
||||
std::list<EffectSchema>::iterator it = std::find_if(effectsSchemas.begin(), effectsSchemas.end(),
|
||||
[&scriptName](const EffectSchema& schema) {return schema.pyFile == scriptName; }
|
||||
);
|
||||
|
||||
if (it != effectsSchemas.end())
|
||||
{
|
||||
@@ -132,17 +114,20 @@ QString EffectFileHandler::saveEffect(const QJsonObject& message)
|
||||
|
||||
if (!effectArray.empty())
|
||||
{
|
||||
if (message["name"].toString().trimmed().isEmpty() || message["name"].toString().trimmed().startsWith(":"))
|
||||
QString effectName = message["name"].toString();
|
||||
if (effectName.trimmed().isEmpty() || effectName.trimmed().startsWith(":"))
|
||||
{
|
||||
return "Can't save new effect. Effect name is empty or begins with a dot.";
|
||||
}
|
||||
|
||||
effectJson["name"] = message["name"].toString();
|
||||
effectJson["name"] = effectName;
|
||||
effectJson["script"] = message["script"].toString();
|
||||
effectJson["args"] = message["args"].toObject();
|
||||
|
||||
std::list<EffectDefinition> availableEffects = getEffects();
|
||||
std::list<EffectDefinition>::iterator iter = std::find_if(availableEffects.begin(), availableEffects.end(), find_effect(message["name"].toString()));
|
||||
std::list<EffectDefinition>::iterator iter = std::find_if(availableEffects.begin(), availableEffects.end(),
|
||||
[&effectName](const EffectDefinition& effectDefinition) {return effectDefinition.name == effectName; }
|
||||
);
|
||||
|
||||
QFileInfo newFileName;
|
||||
if (iter != availableEffects.end())
|
||||
@@ -150,12 +135,12 @@ QString EffectFileHandler::saveEffect(const QJsonObject& message)
|
||||
newFileName.setFile(iter->file);
|
||||
if (newFileName.absoluteFilePath().startsWith(':'))
|
||||
{
|
||||
return "The effect name '" + message["name"].toString() + "' is assigned to an internal effect. Please rename your effect.";
|
||||
return "The effect name '" + effectName + "' is assigned to an internal effect. Please rename your effect.";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QString f = effectArray[0].toString().replace("$ROOT", _rootPath) + '/' + message["name"].toString().replace(QString(" "), QString("")) + QString(".json");
|
||||
QString f = effectArray[0].toString().replace("$ROOT", _rootPath) + '/' + effectName.replace(QString(" "), QString("")) + QString(".json");
|
||||
newFileName.setFile(f);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user