aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2018-11-02 12:35:57 +0100
committerJani Heikkinen <jani.heikkinen@qt.io>2018-11-02 16:43:47 +0000
commitf20839aed0f2e4fe9134a239adda4853d7bd204a (patch)
treec8edd991ac1bc190e767e105176dcbe078054da2
parent6746417e719cee389a37513f830d5cff1b4b9c25 (diff)
Doc: Qt QML: Fix documentation warnings
Add \namespace for for namespace QtQml, as it has logging functions that previously saw no generated documentation. Fix \qmltype name of DelegateChooser, as well as a number of related typos and linking problems. Task-number: QTBUG-71502 Change-Id: I5a9c635853ef73c99a1b1f55cd1c0a1a87fdf6ec Reviewed-by: Martin Smith <martin.smith@qt.io>
-rw-r--r--src/qml/qml/qqmlinfo.cpp63
-rw-r--r--src/qml/types/qqmldelegatecomponent.cpp22
-rw-r--r--src/qml/types/qqmldelegatemodel.cpp2
-rw-r--r--src/qml/types/qqmlitemselectionmodel.qdoc4
4 files changed, 57 insertions, 34 deletions
diff --git a/src/qml/qml/qqmlinfo.cpp b/src/qml/qml/qqmlinfo.cpp
index c8f5ba506f..6322302422 100644
--- a/src/qml/qml/qqmlinfo.cpp
+++ b/src/qml/qml/qqmlinfo.cpp
@@ -50,6 +50,12 @@
QT_BEGIN_NAMESPACE
/*!
+ \namespace QtQml
+ \inmodule QtQml
+ \brief Provides functions for producing logging messages for QML types.
+*/
+
+/*!
\fn QQmlInfo QtQml::qmlDebug(const QObject *object)
\relates QQmlEngine
\since 5.9
@@ -57,6 +63,7 @@ QT_BEGIN_NAMESPACE
Prints debug messages that include the file and line number for the
specified QML \a object.
+//! [qqmlinfo-desc]
When QML types produce logging messages, it improves traceability
if they include the QML file and line number on which the
particular instance was instantiated.
@@ -65,6 +72,7 @@ QT_BEGIN_NAMESPACE
the file and line number is not available for that instance
(either it was not instantiated by the QML engine or location
information is disabled), "unknown location" will be used instead.
+//! [qqmlinfo-desc]
For example,
@@ -74,7 +82,7 @@ QT_BEGIN_NAMESPACE
prints
- \code
+ \badcode
QML MyCustomType (unknown location): Internal state: 42
\endcode
@@ -88,14 +96,7 @@ QT_BEGIN_NAMESPACE
Prints informational messages that include the file and line number for the
specified QML \a object.
- When QML types produce logging messages, it improves traceability
- if they include the QML file and line number on which the
- particular instance was instantiated.
-
- To include the file and line number, an object must be passed. If
- the file and line number is not available for that instance
- (either it was not instantiated by the QML engine or location
- information is disabled), "unknown location" will be used instead.
+ \include qqmlinfo.cpp qqmlinfo-desc
For example,
@@ -105,7 +106,7 @@ QT_BEGIN_NAMESPACE
prints
- \code
+ \badcode
QML MyCustomType (unknown location): component property is a write-once property
\endcode
@@ -116,7 +117,6 @@ QT_BEGIN_NAMESPACE
\sa QtQml::qmlDebug, QtQml::qmlWarning
*/
-
/*!
\fn QQmlInfo QtQml::qmlWarning(const QObject *object)
\relates QQmlEngine
@@ -125,14 +125,7 @@ QT_BEGIN_NAMESPACE
Prints warning messages that include the file and line number for the
specified QML \a object.
- When QML types produce logging messages, it improves traceability
- if they include the QML file and line number on which the
- particular instance was instantiated.
-
- To include the file and line number, an object must be passed. If
- the file and line number is not available for that instance
- (either it was not instantiated by the QML engine or location
- information is disabled), "unknown location" will be used instead.
+ \include qqmlinfo.cpp qqmlinfo-desc
For example,
@@ -142,13 +135,43 @@ QT_BEGIN_NAMESPACE
prints
- \code
+ \badcode
QML MyCustomType (unknown location): property cannot be set to 0
\endcode
\sa QtQml::qmlDebug, QtQml::qmlInfo
*/
+/*!
+ \fn QQmlInfo QtQml::qmlDebug(const QObject *object, const QQmlError &error)
+ \internal
+*/
+
+/*!
+ \fn QQmlInfo QtQml::qmlDebug(const QObject *object, const QList<QQmlError> &errors)
+ \internal
+*/
+
+/*!
+ \fn QQmlInfo QtQml::qmlInfo(const QObject *object, const QQmlError &error)
+ \internal
+*/
+
+/*!
+ \fn QQmlInfo QtQml::qmlInfo(const QObject *object, const QList<QQmlError> &errors)
+ \internal
+*/
+
+/*!
+ \fn QQmlInfo QtQml::qmlWarning(const QObject *object, const QQmlError &error)
+ \internal
+*/
+
+/*!
+ \fn QQmlInfo QtQml::qmlWarning(const QObject *object, const QList<QQmlError> &errors)
+ \internal
+*/
+
class QQmlInfoPrivate
{
public:
diff --git a/src/qml/types/qqmldelegatecomponent.cpp b/src/qml/types/qqmldelegatecomponent.cpp
index 007e8e2ec6..470f6cab6a 100644
--- a/src/qml/types/qqmldelegatecomponent.cpp
+++ b/src/qml/types/qqmldelegatecomponent.cpp
@@ -66,9 +66,9 @@ QVariant QQmlAbstractDelegateComponent::value(QQmlAdaptorModel *adaptorModel, in
To use this module, import the module with the following line:
- \code
+ \qml
import Qt.labs.qmlmodels 1.0
- \endcode
+ \endqml
*/
/*!
@@ -79,6 +79,7 @@ QVariant QQmlAbstractDelegateComponent::value(QQmlAdaptorModel *adaptorModel, in
The DelegateChoice type wraps a delegate and defines the circumstances
in which it should be chosen.
+
DelegateChoices can be nested inside a DelegateChooser.
\sa DelegateChooser
@@ -86,7 +87,7 @@ QVariant QQmlAbstractDelegateComponent::value(QQmlAdaptorModel *adaptorModel, in
/*!
\qmlproperty string QtQml.Models::DelegateChoice::roleValue
- This property holds the value used to match the role data for the role provided by \l DefaultDelegateChooser::role.
+ This property holds the value used to match the role data for the role provided by \l DelegateChooser::role.
*/
QVariant QQmlDelegateChoice::roleValue() const
{
@@ -106,20 +107,20 @@ void QQmlDelegateChoice::setRoleValue(const QVariant &value)
\qmlproperty index QtQml.Models::DelegateChoice::row
This property holds the value used to match the row value of model elements.
With models that have only the index property (and thus only one column), this property
- should be intended as index, and set to the desired index value.
+ should be intended as an index, and set to the desired index value.
\note Setting both row and index has undefined behavior. The two are equivalent and only
one should be used.
- \sa QtQml.Models::DelegateChoice::index
+ \sa index
*/
/*!
\qmlproperty index QtQml.Models::DelegateChoice::index
This property holds the value used to match the index value of model elements.
- This is effectively an alias for \l QtQml.Models::DelegateChoice::row
+ This is effectively an alias for \l row.
- \sa QtQml.Models::DelegateChoice::row
+ \sa row
*/
int QQmlDelegateChoice::row() const
{
@@ -190,14 +191,14 @@ bool QQmlDelegateChoice::match(int row, int column, const QVariant &value) const
}
/*!
- \qmltype QQmlDelegateChooser
+ \qmltype DelegateChooser
\instantiates QQmlDelegateChooser
\inqmlmodule Qt.labs.qmlmodels
\brief Allows a view to use different delegates for different types of items in the model.
The DelegateChooser is a special \l Component type intended for those scenarios where a Component is required
by a view and used as a delegate.
- DelegateChooser encapsulates a set of \l DelegateChoices.
+ DelegateChooser encapsulates a set of \l {DelegateChoice}s.
These choices are used determine the delegate that will be instantiated for each
item in the model.
The selection of the choice is performed based on the value that a model item has for \l role,
@@ -227,13 +228,14 @@ void QQmlDelegateChooser::setRole(const QString &role)
/*!
\qmlproperty list<DelegateChoice> QtQml.Models::DelegateChooser::choices
\default
+
The list of DelegateChoices for the chooser.
The list is treated as an ordered list, where the first DelegateChoice to match
will be used be a view.
It should not generally be necessary to refer to the \c choices property,
- as it is the default property for DefaultDelegateChooser and thus all child items are
+ as it is the default property for DelegateChooser and thus all child items are
automatically assigned to this property.
*/
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp
index 243a7ce749..8a0d60a092 100644
--- a/src/qml/types/qqmldelegatemodel.cpp
+++ b/src/qml/types/qqmldelegatemodel.cpp
@@ -437,8 +437,6 @@ void QQmlDelegateModel::setModel(const QVariant &model)
The delegate provides a template defining each item instantiated by a view.
The index is exposed as an accessible \c index property. Properties of the
model are also available depending upon the type of \l {qml-data-models}{Data Model}.
-
- \sa DelegateComponent
*/
QQmlComponent *QQmlDelegateModel::delegate() const
{
diff --git a/src/qml/types/qqmlitemselectionmodel.qdoc b/src/qml/types/qqmlitemselectionmodel.qdoc
index 7ddfd79217..43da4f7a55 100644
--- a/src/qml/types/qqmlitemselectionmodel.qdoc
+++ b/src/qml/types/qqmlitemselectionmodel.qdoc
@@ -52,7 +52,7 @@
It will trigger property binding updates every time \l selectionChanged()
is emitted, even though its value hasn't changed.
- \sa selection(), selectedIndexes, select(), selectionChanged()
+ \sa selection, selectedIndexes, select(), selectionChanged()
*/
/*!
@@ -235,5 +235,5 @@
Note that this signal will not be emitted when the item model is reset.
- \sa currentIndex(), setCurrentIndex(), selectionChanged()
+ \sa currentIndex, setCurrentIndex(), selectionChanged()
*/