diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2023-10-31 19:48:17 +0100 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2023-10-31 19:54:22 +0100 |
commit | 403e231c9b5295a04fd3c96009e3c5eabc5639a0 (patch) | |
tree | e72984b7803f8ab95483514ef1d37a6d833e3299 | |
parent | 2327961711c7be4c71d9dec4a68e967110bb4f2b (diff) |
Fix Qt 6 build
Change-Id: If2180a85d374c03a4a78e5eeba7cc92daaac992a
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r-- | src/imports/utils/quickstudiocsvtablemodel.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/imports/utils/quickstudiocsvtablemodel.cpp b/src/imports/utils/quickstudiocsvtablemodel.cpp index d3b2616..e3dbc87 100644 --- a/src/imports/utils/quickstudiocsvtablemodel.cpp +++ b/src/imports/utils/quickstudiocsvtablemodel.cpp @@ -44,6 +44,15 @@ #include <QRegularExpression> #include <QTextStream> +static inline QColor fromString(const QString &colorName) +{ +#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0) + return QColor::fromString(colorName); +#else + return colorName; +#endif // >= Qt 6.4 +} + static inline bool isValidColorName(const QString &colorName) { #if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0) @@ -78,7 +87,7 @@ static QVariant stringToVariant(const QString &value) return trimmedValue.toDouble(); if (!match.captured(u"color").isEmpty()) - return QColor::fromString(trimmedValue); + return ::fromString(trimmedValue); return value; } @@ -120,7 +129,7 @@ static QVariant stringToVariant(const QString &value, QMetaType::Type type, bool *ok = conversionOk; if (conversionOk) - return QColor::fromString(value); + return ::fromString(value); } if (type == QMetaType::QString) { |