diff options
author | Fabian Kosmale <[email protected]> | 2025-06-04 13:41:58 +0200 |
---|---|---|
committer | Fabian Kosmale <[email protected]> | 2025-06-05 20:58:21 +0200 |
commit | 0c705ac038060fec72e7804d90f780d134f790f2 (patch) | |
tree | 012e28aa2cca7b694c7acd505b1ef2037d0fe945 /src | |
parent | 5ee06587fa9bf8f9eaef402851e34438c64ff94e (diff) |
QColor::fromString does not care about the casing of named colors, and
conseqently neither does the QML engine. Unconditionally lower case the
color in the check to accomadate it.
Pick-to: 6.10
Change-Id: I35aa4162bcd8682bbea86776c9929e00f891cdb9
Reviewed-by: Sami Shalayel <[email protected]>
Reviewed-by: Olivier De Cannière <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/qmllint/quick/quicklintplugin.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/qmllint/quick/quicklintplugin.cpp b/src/plugins/qmllint/quick/quicklintplugin.cpp index 4b02e49d41..2876477d95 100644 --- a/src/plugins/qmllint/quick/quicklintplugin.cpp +++ b/src/plugins/qmllint/quick/quicklintplugin.cpp @@ -706,7 +706,11 @@ void ColorValidatorPass::onBinding(const QQmlSA::Element &element, const QString if (!propertyType || propertyType != m_colorType) return; - const QString colorName = binding.stringValue(); + QString colorName = binding.stringValue(); + // for "named" colors, QColor::fromString does not care about + // the case + if (!colorName.startsWith(u'#')) + colorName = std::move(colorName).toLower(); if (s_hexPattern.match(colorName).hasMatch()) return; |