aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/qmllint/quick/quicklintplugin.cpp3
-rw-r--r--tests/auto/qml/qmllint/tst_qmllint.cpp1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/qmllint/quick/quicklintplugin.cpp b/src/plugins/qmllint/quick/quicklintplugin.cpp
index 2876477d95..c030cead18 100644
--- a/src/plugins/qmllint/quick/quicklintplugin.cpp
+++ b/src/plugins/qmllint/quick/quicklintplugin.cpp
@@ -717,6 +717,9 @@ void ColorValidatorPass::onBinding(const QQmlSA::Element &element, const QString
if (std::binary_search(m_colorNames.cbegin(), m_colorNames.cend(), colorName))
return;
+ if (colorName == u"transparent")
+ return;
+
auto suggestion = QQmlJSUtils::didYouMean(
colorName, m_colorNames,
QQmlSA::SourceLocationPrivate::sourceLocation(binding.sourceLocation()));
diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp
index 75749107a7..3982e0ed26 100644
--- a/tests/auto/qml/qmllint/tst_qmllint.cpp
+++ b/tests/auto/qml/qmllint/tst_qmllint.cpp
@@ -1531,6 +1531,7 @@ void TestQmllint::cleanQmlSnippet_data()
QTest::newRow("color-name") << u"property color myColor: \"blue\""_s << defaultOptions;
QTest::newRow("color-name2") << u"property color myColor\nmyColor: \"grEen\""_s
<< defaultOptions;
+ QTest::newRow("color-transparent") << u"property color myColor: \"transparent\""_s << defaultOptions;
{
CallQmllintOptions options;
options.rootUrls.append(testFile("ContextProperties/src"_L1));