diff --git a/doc/qtcreator/src/editors/creator-code-syntax.qdoc b/doc/qtcreator/src/editors/creator-code-syntax.qdoc index 65e41022e37..f54337dd903 100644 --- a/doc/qtcreator/src/editors/creator-code-syntax.qdoc +++ b/doc/qtcreator/src/editors/creator-code-syntax.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -291,7 +291,7 @@ \row \li M106 \li Warning - \li \c Name is already a var + \li \c Name already is a var \li \row @@ -416,6 +416,12 @@ \li A state cannot have the specified child item \li + \row + \li M129 + \li Error + \li Type cannot be instantiated recursively + \li + \row \li M201 \li Hint @@ -430,6 +436,7 @@ \li Use only one statement per line \li + \if defined(qtdesignstudio) \row \li M203 \li Warning @@ -463,60 +470,70 @@ \row \li M208 \li Error - \li This id might be ambiguous and is not supported in \QDS. + \li This id might be ambiguous and is not supported in \QDS \li \row \li M209 \li Error \li This type (type name) is not supported as a root element in - \QDS. + \QDS \li + \endif \row \li M220 \li Error \li This type (type name) is not supported as a root element of a - UI file (.ui.qml). - \li + UI file (.ui.qml) + \li For more information about supported QML types, see \l{UI Files}. \row \li M221 \li Error - \li This type (type name) is not supported in a UI file (.ui.qml). - \li + \li This type (type name) is not supported in a UI file (.ui.qml) + \li For more information about supported QML types, see \l{UI Files}. \row \li M222 \li Error - \li Functions are not supported in a UI file (.ui.qml). + \li Functions are not supported in a UI file (.ui.qml) \li For a list of supported JavaScript functions, see \l{Supported Methods}. \row \li M223 \li Error - \li Java Script blocks are not supported in a UI file (.ui.qml). - \li + \li JavaScript blocks are not supported in a UI file (.ui.qml) + \li For more information about supported features, see \l{UI Files}. \row \li M224 \li Error - \li Behavior type is not supported in a UI file (.ui.qml). - \li + \li Behavior type is not supported in a UI file (.ui.qml) + \li For more information about supported QML types, see \l{UI Files}. \row \li M225 \li Error - \li States are only supported in the root item in a UI file (.ui.qml). - \li + \li States are only supported in the root item in a UI file (.ui.qml) + \li For more information about supported features, see \l{UI Files}. \row \li M226 \li Error \li Referencing the parent of the root item is not supported in a - UI file (.ui.qml). - \li + UI file (.ui.qml) + \li For more information about supported features, see \l{UI Files}. + + \row + \li M227 + \li Error + \li Do not mix translation functions in a UI file (.ui.qml) + \li Even though several different translation functions, such as + \c qsTr and \c qsTrId are supported, you should pick one and + use it consistently within a UI file. For more information, + see \l{Qt QML Methods}. \row \li M300 @@ -674,11 +691,30 @@ and most likely invalid \li + \row + \li M325 + \li Warning + \li Logical value does not depend on actual values + \li + + \row + \li M326 + \li Error + \li Components are only allowed to have a single child element + \li For more information, see \l [QML] {Component}. + + \row + \li M327 + \li Warning + \li Components require a child element + \li For more information, see \l [QML] {Component}. + \row \li M400 \li Warning \li Duplicate import - \li + \li An import statement has been added twice. For more information, + see \l{Import Statements}. \endtable diff --git a/doc/qtcreator/src/qtquick/qtquick-ui-forms.qdoc b/doc/qtcreator/src/qtquick/qtquick-ui-forms.qdoc index fb76d5250cb..a21991f7ba8 100644 --- a/doc/qtcreator/src/qtquick/qtquick-ui-forms.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-ui-forms.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2021 The Qt Company Ltd. +** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -52,6 +52,7 @@ be edited in \QDS only. \endif + The following features are not supported in .ui.qml files: \list @@ -61,6 +62,7 @@ \li States in other components than the root component \li Root components that are not derived from \l QQuickItem or \l [QML]{Item} + \li Referencing the parent of the root component \endlist The following components are not supported: @@ -69,11 +71,9 @@ \li Behavior \li Binding \li Canvas - \li Component \li Shader Effect \li Timer \li Transform - \li Transition \endlist \section1 Supported Methods @@ -165,6 +165,8 @@ \li \l{Qt::}{qsTrNoOp()} \endlist + \note Do not mix translation methods in a UI file. + For more information about using the methods, see \l{https://doc.qt.io/qt/qml-qtqml-qt.html}{Qt QML Methods}. diff --git a/src/libs/qmljs/qmljsstaticanalysismessage.cpp b/src/libs/qmljs/qmljsstaticanalysismessage.cpp index c65508bdfa5..0c026ecb75f 100644 --- a/src/libs/qmljs/qmljsstaticanalysismessage.cpp +++ b/src/libs/qmljs/qmljsstaticanalysismessage.cpp @@ -71,7 +71,7 @@ static inline QString msgInvalidConstructor(const char *what) StaticAnalysisMessages::StaticAnalysisMessages() { // When changing a message or severity, update the documentation, currently - // in creator-editors.qdoc, accordingly. + // in creator-code-syntax.qdoc, accordingly. newMsg(ErrInvalidEnumValue, Error, tr("Invalid value for enum.")); newMsg(ErrEnumValueMustBeStringOrNumber, Error, @@ -211,36 +211,36 @@ StaticAnalysisMessages::StaticAnalysisMessages() newMsg(ErrInvalidArrayValueLength, Error, tr("%1 elements expected in array value."), 1); newMsg(WarnImperativeCodeNotEditableInVisualDesigner, Warning, - tr("Imperative code is not supported in the Qt Quick Designer.")); + tr("Imperative code is not supported in Qt Design Studio.")); newMsg(WarnUnsupportedTypeInVisualDesigner, Warning, - tr("This type (%1) is not supported in the Qt Quick Designer."), 1); + tr("This type (%1) is not supported in Qt Design Studio."), 1); newMsg(WarnReferenceToParentItemNotSupportedByVisualDesigner, Warning, - tr("Reference to parent item cannot be resolved correctly by the Qt Quick Designer.")); + tr("Reference to parent item cannot be resolved correctly by Qt Design Studio.")); newMsg(WarnUndefinedValueForVisualDesigner, Warning, tr("This visual property binding cannot be evaluated in the local context " - "and might not show up in Qt Quick Designer as expected.")); + "and might not show up in Qt Design Studio as expected.")); newMsg(WarnStatesOnlyInRootItemForVisualDesigner, Warning, - tr("Qt Quick Designer only supports states in the root item.")); + tr("Qt Design Studio only supports states in the root item.")); newMsg(ErrInvalidIdeInVisualDesigner, Error, - tr("This id might be ambiguous and is not supported in the Qt Quick Designer.")); + tr("This id might be ambiguous and is not supported in Qt Design Studio.")); newMsg(ErrUnsupportedRootTypeInVisualDesigner, Error, - tr("This type (%1) is not supported as a root element by Qt Quick Designer."), 1); + tr("This type (%1) is not supported as a root element by Qt Design Studio."), 1); newMsg(ErrUnsupportedRootTypeInQmlUi, Error, - tr("This type (%1) is not supported as a root element of a Qt Quick UI form."), 1); + tr("This type (%1) is not supported as a root element of a UI file (.ui.qml)."), 1); newMsg(ErrUnsupportedTypeInQmlUi, Error, - tr("This type (%1) is not supported in a Qt Quick UI form."), 1); + tr("This type (%1) is not supported in a UI file (.ui.qml)."), 1); newMsg(ErrFunctionsNotSupportedInQmlUi, Error, - tr("Functions are not supported in a Qt Quick UI form.")); + tr("Functions are not supported in a UI file (.ui.qml).")); newMsg(ErrBlocksNotSupportedInQmlUi, Error, - tr("JavaScript blocks are not supported in a Qt Quick UI form.")); + tr("JavaScript blocks are not supported in a UI file (.ui.qml).")); newMsg(ErrBehavioursNotSupportedInQmlUi, Error, - tr("Behavior type is not supported in a Qt Quick UI form.")); + tr("Behavior type is not supported in a UI file (.ui.qml).")); newMsg(ErrStatesOnlyInRootItemInQmlUi, Error, - tr("States are only supported in the root item in a Qt Quick UI form.")); + tr("States are only supported in the root item in a UI file (.ui.qml).")); newMsg(ErrReferenceToParentItemNotSupportedInQmlUi, Error, - tr("Referencing the parent of the root item is not supported in a Qt Quick UI form.")); + tr("Referencing the parent of the root item is not supported in a UI file (.ui.qml).")); newMsg(ErrDoNotMixTranslationFunctionsInQmlUi, Error, - tr("Do not mix translation functions in a Qt Quick UI form.")); + tr("Do not mix translation functions in a UI file (.ui.qml).")); newMsg(StateCannotHaveChildItem, Error, tr("A State cannot have a child item (%1)."), 1); newMsg(WarnDuplicateImport, Warning, @@ -250,7 +250,7 @@ StaticAnalysisMessages::StaticAnalysisMessages() newMsg(ErrTypeIsInstantiatedRecursively, Error, tr("Type cannot be instantiated recursively (%1)."), 1); newMsg(WarnLogicalValueDoesNotDependOnValues, Warning, - tr("Logical value does not depend on actual values")); + tr("Logical value does not depend on actual values.")); newMsg(ErrToManyComponentChildren, Error, tr("Components are only allowed to have a single child element.")); newMsg(WarnComponentRequiresChildren, Warning,