From 410f835a40bda737c8933fe630251752fba2ba4f Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 19 Feb 2020 00:15:27 +0100 Subject: Doc: Fix documentation warnings for Qt QML MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: QTBUG-82313 Change-Id: I7c2f30411ab8011254d7c232c87cb12a39761bda Reviewed-by: Topi Reiniƶ --- src/qml/doc/src/cppintegration/definetypes.qdoc | 2 +- src/qml/doc/src/qmlfunctions.qdoc | 19 ++++++++++--------- .../doc/src/qmllanguageref/documents/definetypes.qdoc | 9 +++++---- .../src/qmllanguageref/syntax/objectattributes.qdoc | 2 +- 4 files changed, 17 insertions(+), 15 deletions(-) (limited to 'src/qml/doc/src') diff --git a/src/qml/doc/src/cppintegration/definetypes.qdoc b/src/qml/doc/src/cppintegration/definetypes.qdoc index f66dc44383..cbbbd9ba58 100644 --- a/src/qml/doc/src/cppintegration/definetypes.qdoc +++ b/src/qml/doc/src/cppintegration/definetypes.qdoc @@ -307,7 +307,7 @@ merged with the original target class when used from within QML. For example: The \c leftMargin property is a new property added to an existing C++ type, \l QLineEdit, without modifying its source code. -The \l {QML_EXTENDED(extended)} macro is for registering extended types. The +The QML_EXTENDED(extended) macro is for registering extended types. The argument is the name of another class to be used as extension. An extension class is a regular QObject, with a constructor that takes a QObject diff --git a/src/qml/doc/src/qmlfunctions.qdoc b/src/qml/doc/src/qmlfunctions.qdoc index 63c28d7aa7..04d907f168 100644 --- a/src/qml/doc/src/qmlfunctions.qdoc +++ b/src/qml/doc/src/qmlfunctions.qdoc @@ -27,7 +27,7 @@ /*! \macro QML_ELEMENT - \related QQmlEngine + \relates QQmlEngine Declares the enclosing type or namespace to be available in QML, using its class or namespace name as the QML element name. @@ -45,10 +45,10 @@ \endcode You can use the build system to register the type in the type namespace - "com.mycompany.qmlcomponents" with major version \c 1 by specifying the + \e {com.mycompany.qmlcomponents} with major version \c 1 by specifying the following in your project file: - \code + \badcode CONFIG += qmltypes QML_IMPORT_NAME = com.mycompany.qmlcomponents QML_IMPORT_MAJOR_VERSION = 1 @@ -74,7 +74,7 @@ /*! \macro QML_NAMED_ELEMENT(name) - \related QQmlEngine + \relates QQmlEngine Declares the enclosing type or namespace to be available in QML, using \a name as the element name. Otherwise behaves the same as QML_ELEMENT. @@ -209,7 +209,7 @@ {attached property} to other types. This takes effect if the type is exposed to QML using a \l QML_ELEMENT or \l QML_NAMED_ELEMENT() macro. - \sa QML_ELEMENT, QML_NAMED_ELEMENT(), qmlAtachedPropertiesObject(), + \sa QML_ELEMENT, QML_NAMED_ELEMENT(), qmlAttachedPropertiesObject(), {Providing Attached Properties} */ @@ -234,7 +234,7 @@ \l QML_ATTACHED(), or \l QML_EXTENDED() macros in the enclosing C++ type do not apply to the enclosing type but instead to \a FOREIGN_TYPE. The enclosing type still needs to be registered with the - \l {The Meta-Object System}{meta object system} using a \l G_GADGET or + \l {The Meta-Object System}{meta object system} using a \l Q_GADGET or \l Q_OBJECT macro. This is useful for registering types that cannot be amended to add the macros, @@ -278,13 +278,14 @@ This will cause any QML which attempts to use the "Game" type to produce an error message: - \code + + \badcode fun.qml: Get back to work, slacker! Game { ^ \endcode - Using this technique, you only need a \l G_GADGET struct to customize the error + Using this technique, you only need a \l Q_GADGET struct to customize the error message, not a full-blown \l QObject. Without \l QML_UNCREATABLE(), \l QML_UNAVAILABLE still results in a more specific error message than the usual "is not a type" for completely unknown types. @@ -905,7 +906,7 @@ */ /*! - \fn int qmlRegisterSingletonInstance(const char *uri, int versionMajor, int versionMinor, const char *typeName, QObject* cppObject) + \fn template auto qmlRegisterSingletonInstance(const char *uri, int versionMajor, int versionMinor, const char *typeName, T *cppObject) \relates QQmlEngine \since 5.14 diff --git a/src/qml/doc/src/qmllanguageref/documents/definetypes.qdoc b/src/qml/doc/src/qmllanguageref/documents/definetypes.qdoc index 2eaedf8f9b..a4119ff793 100644 --- a/src/qml/doc/src/qmllanguageref/documents/definetypes.qdoc +++ b/src/qml/doc/src/qmllanguageref/documents/definetypes.qdoc @@ -125,10 +125,11 @@ component : BaseType { Inside the file which declares the inline component, the type can be referenced simply by its name. -\snippet src/qml/doc/snippets/qml/qml-documents/Images.qml document +\snippet qml/qml-documents/Images.qml document In other files, it has to be prefixed with the name of its containing component. -\snippet src/qml/doc/snippets/qml/qml-documents/LabeledImageBox.qml document + +\snippet qml/qml-documents/LabeledImageBox.qml document \note Inline components don't share their scope with the component they are declared in. In the following example, when \c A.MyInlineComponent in file @@ -137,8 +138,8 @@ an id in B.qml. It is therefore advisable not to reference objects in an inline component which are not part of it. -\snippet src/qml/doc/snippets/qml/qml-documents/A.qml document -\snippet src/qml/doc/snippets/qml/qml-documents/B.qml document +\snippet qml/qml-documents/A.qml document +\snippet qml/qml-documents/B.qml document \note Inline components cannot be nested. diff --git a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc index 832d9a9e26..ecfef2e04f 100644 --- a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc +++ b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc @@ -684,7 +684,7 @@ Required properties play a special role in model-view-delegate code: If the delegate of a view has required properties whose names match with the role names of the view's model, then those properties will be initialized with the model's corresponding values. -For more information, visit the \l{Models and Views in QtQuick} page. +For more information, visit the \l{Models and Views in Qt Quick} page. \sa {QQmlComponent::createWithInitialProperties}, {QQmlApplicationEngine::setInitialProperties} and {QQuickView::setInitialProperties} for ways to initialize required properties from C++. -- cgit v1.2.3