aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/qmljs/qmljscheck.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/qmljs/qmljscheck.cpp')
-rw-r--r--src/libs/qmljs/qmljscheck.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/libs/qmljs/qmljscheck.cpp b/src/libs/qmljs/qmljscheck.cpp
index 07a9d247327..0b5eb1943cf 100644
--- a/src/libs/qmljs/qmljscheck.cpp
+++ b/src/libs/qmljs/qmljscheck.cpp
@@ -768,10 +768,21 @@ bool Check::visit(UiPublicMember *ast)
QString preferedType;
if (init->asNumberValue())
preferedType = tr("'int' or 'real'");
- if (init->asStringValue())
+ else if (init->asStringValue())
preferedType = QLatin1String("'string'");
- if (init->asBooleanValue())
+ else if (init->asBooleanValue())
preferedType = QLatin1String("'bool'");
+ else if (init->asColorValue())
+ preferedType = QLatin1String("'color'");
+ else if (init == _context->valueOwner()->qmlPointObject())
+ preferedType = QLatin1String("'point'");
+ else if (init == _context->valueOwner()->qmlRectObject())
+ preferedType = QLatin1String("'rect'");
+ else if (init == _context->valueOwner()->qmlSizeObject())
+ preferedType = QLatin1String("'size'");
+ else if (init == _context->valueOwner()->qmlVector3DObject())
+ preferedType = QLatin1String("'vector3d'");
+
if (!preferedType.isEmpty())
addMessage(HintPreferNonVarPropertyType, ast->typeToken, preferedType);
}