chore: split cmake into multiple files and fix settings searching regex + add enabled option to llm

This commit is contained in:
2026-09-30 15:01:28 +02:00
parent d5d2311c24
commit e58440fea4
19 changed files with 849 additions and 641 deletions
+31
View File
@@ -0,0 +1,31 @@
#pragma once
#include <qmetaobject.h>
#include <qmetatype.h>
#include <qvariant.h>
namespace util {
inline QMetaEnum metaEnumFor(const QMetaType& type) {
const auto* meta = type.metaObject();
if (!meta) return {};
auto name = QByteArray(type.name());
if (const auto scope = name.lastIndexOf("::"); scope >= 0)
name = name.mid(scope + 2);
return meta->enumerator(meta->indexOfEnumerator(name.constData()));
}
inline bool isSupportedEnum(const QMetaType& type) {
if (!type.flags().testFlag(QMetaType::IsEnumeration)) return false;
const auto metaEnum = metaEnumFor(type);
return metaEnum.isValid() && !metaEnum.is64Bit();
}
inline const char* enumKeyFor(const QMetaEnum& metaEnum, const QVariant& value) {
return metaEnum.valueToKey(static_cast<quint64>(value.toLongLong()));
}
} // namespace util