From 277f65e12d7d571168808d5d016743abd0da3aca Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Fri, 25 Oct 2024 15:07:09 +0200 Subject: [PATCH] Doc: Update JavaScrip and QML error codes - Add "A when condition cannot contain an object." and fix the typo in the user-visible text. - Remove M325, which has been removed from the sources. Task-number: QTCREATORBUG-31510 Change-Id: Iec793c0625496e50456a8b998ca12b2f37cd36ad Reviewed-by: Mats Honkamaa Reviewed-by: Sami Shalayel Reviewed-by: Thomas Hartmann --- doc/qtcreator/src/editors/creator-code-syntax.qdoc | 13 +++++++------ src/libs/qmljs/qmljsstaticanalysismessage.cpp | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/doc/qtcreator/src/editors/creator-code-syntax.qdoc b/doc/qtcreator/src/editors/creator-code-syntax.qdoc index f59ba0fd941..c9712d66320 100644 --- a/doc/qtcreator/src/editors/creator-code-syntax.qdoc +++ b/doc/qtcreator/src/editors/creator-code-syntax.qdoc @@ -708,12 +708,6 @@ and most likely invalid \li - \row - \li M325 - \li Warning - \li Logical value does not depend on actual values - \li Removed: This warning is no longer being used since Qt Creator version 12. - \row \li M326 \li Error @@ -747,6 +741,13 @@ \li The alias property cannot reference the root component in a hierarchy. Create an instance of the component instead. + \row + \li M403 + \li Error + \li A when condition cannot contain an object + \li Set the \c when condition to an expression that evaluates to \c true + when the condition is met. + \endtable \section1 Resetting the Code Model diff --git a/src/libs/qmljs/qmljsstaticanalysismessage.cpp b/src/libs/qmljs/qmljsstaticanalysismessage.cpp index db539099c64..ffd66d0baac 100644 --- a/src/libs/qmljs/qmljsstaticanalysismessage.cpp +++ b/src/libs/qmljs/qmljsstaticanalysismessage.cpp @@ -240,7 +240,7 @@ StaticAnalysisMessages::StaticAnalysisMessages() Tr::tr("Do not reference the root item as alias.")); newMsg(WarnAliasReferRootHierarchy, Warning, Tr::tr("Avoid referencing the root item in a hierarchy.")); - newMsg(ErrWhenConditionCannotBeObject, Error, Tr::tr("When condtion cannot contain an object.")); + newMsg(ErrWhenConditionCannotBeObject, Error, Tr::tr("A when condition cannot contain an object.")); } } // anonymous namespace