clean up qmllint docs
Use active voice where possible, use sentence-style-capitalization, remove the section list and add the [category]-spelling to help SEO find the help pages. Add a new macro that adds the repetitive sentence about qmllint spelling its categories with the []-brackets. Also avoid having the same name for titles and sections, and rename accordingly. Also join some alternative "To fix this ..." ideas in the examples together. Also avoid calling read-only properties constant, as that might cause some confusion. Pick-to: 6.8 6.7 Fixes: QTBUG-127640 Change-Id: Id5c041a8e15c4af4d7fd24b9409a12caab177269 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
parent
ac309fdee0
commit
aa258d7816
|
@ -80,3 +80,5 @@ spurious += "C\\+\\+ class .*\\\\instantiates .*"
|
|||
|
||||
# Enforce zero documentation warnings
|
||||
warninglimit = 0
|
||||
|
||||
macro.qmllintwarningcategory = "This warning category is spelled \c{[\1]} by qmllint."
|
||||
|
|
|
@ -5,10 +5,12 @@
|
|||
\page qmllint-warnings-and-errors-alias-cycle.html
|
||||
\ingroup qmllint-warnings-and-errors
|
||||
|
||||
\title Alias Cycle
|
||||
\title Alias cycle
|
||||
\brief Alias property is part of an alias cycle.
|
||||
|
||||
\section1 Alias Property Is Part Of An Alias Cycle
|
||||
\qmllintwarningcategory alias-cycle
|
||||
|
||||
\section1 Alias property is part of an alias cycle
|
||||
|
||||
\section2 What happened?
|
||||
A \l{QML Object Attributes#property-aliases}{property alias} resolves to itself or to another
|
||||
|
@ -38,7 +40,7 @@ Item {
|
|||
property alias indirect: someId.cycle // not ok: referring to alias indirectly referring to itself
|
||||
}
|
||||
\endqml
|
||||
You can fix this warning by breaking up the alias cycles:
|
||||
To fix this warning, break up the alias cycles:
|
||||
\qml
|
||||
import QtQuick
|
||||
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
\title Attached property reuse
|
||||
\brief Attached type was initialized multiple times.
|
||||
|
||||
\qmllintwarningcategory attached-property-reuse
|
||||
|
||||
\section1 Using attached type already initialized in a parent scope
|
||||
|
||||
\section2 What happened?
|
||||
|
|
|
@ -8,7 +8,9 @@
|
|||
\title Deprecated
|
||||
\brief A deprecated property or type was used.
|
||||
|
||||
\section1 Deprecated Binding or Type
|
||||
\qmllintwarningcategory deprecated
|
||||
|
||||
\section1 Deprecated binding or type
|
||||
|
||||
\section2 What happened?
|
||||
A deprecated type was instantiated, a deprecated property was used or a deprecated method was
|
||||
|
|
|
@ -5,17 +5,12 @@
|
|||
\page qmllint-warnings-and-errors-duplicate-property-binding.html
|
||||
\ingroup qmllint-warnings-and-errors
|
||||
|
||||
\title Duplicate Bindings
|
||||
\title Duplicate bindings
|
||||
\brief A property was bound multiple times.
|
||||
|
||||
This warning category has multiple warnings:
|
||||
\list
|
||||
\li \l{Duplicate Interceptor On Property}
|
||||
\li \l{Cannot Combine Value Source And Binding}
|
||||
\li \l{Duplicate Value Source On Property}
|
||||
\endlist
|
||||
\qmllintwarningcategory duplicate-property-binding
|
||||
|
||||
\section1 Duplicate Interceptor On Property
|
||||
\section1 Duplicate interceptor on property
|
||||
|
||||
\section2 What happened?
|
||||
One property has multiple \l{Property Modifier Types}{interceptors}.
|
||||
|
@ -38,7 +33,7 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
\endqml
|
||||
You can fix this warning by removing all but one \l{Behavior}:
|
||||
To fix this warning, remove all but one \l{Behavior}:
|
||||
\qml
|
||||
import QtQuick
|
||||
|
||||
|
@ -51,7 +46,7 @@ Rectangle {
|
|||
|
||||
\b {See also} \l {Property Modifier Types}.
|
||||
|
||||
\section1 Duplicate Value Source On Property
|
||||
\section1 Duplicate value source on property
|
||||
|
||||
\section2 What happened?
|
||||
One property has multiple \l{Property Value Sources}{value sources}.
|
||||
|
@ -75,7 +70,7 @@ Rectangle {
|
|||
|
||||
If you check the output of that program, you will see that the two NumberAnimation will interleave
|
||||
each other, which is probably not the effect that was intended.
|
||||
You can fix this warning by removing all but one \l{NumberAnimation}:
|
||||
To fix this warning, remove all but one \l{NumberAnimation}:
|
||||
\qml
|
||||
import QtQuick
|
||||
|
||||
|
@ -85,7 +80,7 @@ Rectangle {
|
|||
\endqml
|
||||
|
||||
|
||||
\section1 Cannot Combine Value Source And Binding
|
||||
\section1 Cannot combine value source and binding
|
||||
|
||||
\section2 What happened?
|
||||
One property has a \l{Property Value Sources}{value source} and a binding on the same property.
|
||||
|
|
|
@ -5,14 +5,10 @@
|
|||
\page qmllint-warnings-and-errors-duplicated-name.html
|
||||
\ingroup qmllint-warnings-and-errors
|
||||
|
||||
\title Duplicated Name
|
||||
\title Duplicated name
|
||||
\brief Multiple signals or properties share the same name in the same Component.
|
||||
|
||||
This warning category has multiple warnings:
|
||||
\list
|
||||
\li \l{Duplicated Property Name}
|
||||
\li \l{Duplicated Signal Name}
|
||||
\endlist
|
||||
\qmllintwarningcategory duplicated-name
|
||||
|
||||
\section1 Duplicated Property Name
|
||||
|
||||
|
@ -31,7 +27,7 @@ Item {
|
|||
property int helloWorld
|
||||
}
|
||||
\endqml
|
||||
You can fix this warning by removing the duplicate property or renaming it:
|
||||
To fix this warning, remove the duplicate property or rename it:
|
||||
\qml
|
||||
import QtQuick
|
||||
|
||||
|
@ -40,7 +36,7 @@ Item {
|
|||
}
|
||||
\endqml
|
||||
|
||||
\section1 Duplicated Signal Name
|
||||
\section1 Duplicated signal mame
|
||||
|
||||
\section2 What happened?
|
||||
Multiple signals in the same QML component scope have the same name.
|
||||
|
@ -57,7 +53,7 @@ Rectangle {
|
|||
signal helloWorld
|
||||
}
|
||||
\endqml
|
||||
You can fix this warning by removing the duplicate signal or renaming it:
|
||||
To fix this warning, remove the duplicate signal or rename it:
|
||||
\qml
|
||||
import QtQuick
|
||||
|
||||
|
|
|
@ -5,18 +5,12 @@
|
|||
\page qmllint-warnings-and-errors-import.html
|
||||
\ingroup qmllint-warnings-and-errors
|
||||
|
||||
\title Warnings Occurred While Importing
|
||||
\title Warnings occurred while importing
|
||||
\brief The imported module was not found.
|
||||
|
||||
This warning category contains multiple warnings:
|
||||
\list
|
||||
\li \l{Failed To Import Module}
|
||||
\li \l{Component Was Not Found}
|
||||
\li \l{Import Qualifier Must Start With A Capital Letter}
|
||||
\li \l{Unknown Import Syntax}
|
||||
\endlist
|
||||
\qmllintwarningcategory import
|
||||
|
||||
\section1 Failed To Import Module
|
||||
\section1 Failed to import module
|
||||
|
||||
\section2 What happened?
|
||||
The module imported via \l{Import Statements}{import statement} was not found.
|
||||
|
@ -41,7 +35,7 @@ import QtQuicky // not ok: typo in module name
|
|||
Item {
|
||||
}
|
||||
\endqml
|
||||
You can fix this warning by correcting the typo:
|
||||
To fix this warning, correct the typo:
|
||||
\qml
|
||||
import QtQuick // ok: no typo in module name
|
||||
|
||||
|
@ -49,7 +43,7 @@ Item {
|
|||
}
|
||||
\endqml
|
||||
|
||||
\section3 User-Defined Module That Was Not Built
|
||||
\section3 User-defined module that was not built
|
||||
|
||||
Some tooling like \l{\QMLLS Reference}{\QMLLS} or \l{qmllint Reference}{qmllint}
|
||||
can't find user-defined modules when they
|
||||
|
@ -61,20 +55,20 @@ instructions in
|
|||
\l{Setting up the \QMLLS in Your Editor}{\QMLLS setup instructions}
|
||||
and make sure that you communicate the correct build folder to \QMLLS.
|
||||
|
||||
\section3 Wrong Import Path
|
||||
\section3 Wrong import path
|
||||
|
||||
Please refer to \l{Import Statements#qml-import-path}{the QML import path documentation} and to
|
||||
\l{Debugging QML Applications#debugging-module-imports}{the debugging module import documentation}
|
||||
for more information about import paths.
|
||||
|
||||
\section3 Missing Module
|
||||
\section3 Missing module
|
||||
|
||||
If the previous sections did not help to find the imported module, it might be missing.
|
||||
This might be caused by a missing dependency. When using external libraries, verify that they are
|
||||
actually installed, and that their modules end up in an
|
||||
\l{Import Statements#qml-import-path}{import path}.
|
||||
|
||||
\section1 Component Was Not Found
|
||||
\section1 Component was not found
|
||||
|
||||
\section2 What happened?
|
||||
Some component was not found.
|
||||
|
@ -84,7 +78,7 @@ The application can't run because it can't instantiate the non-found component.
|
|||
|
||||
\section2 Examples
|
||||
|
||||
\section3 Typo In The Component Name
|
||||
\section3 Typo in the component name
|
||||
\qml
|
||||
import QtQuick
|
||||
|
||||
|
@ -92,7 +86,7 @@ Item {
|
|||
Itemy {} // not ok: typo in name
|
||||
}
|
||||
\endqml
|
||||
You can fix this warning by correcting the typo:
|
||||
To fix this warning, correct the typo:
|
||||
\qml
|
||||
import QtQuick
|
||||
|
||||
|
@ -101,14 +95,14 @@ Item {
|
|||
}
|
||||
\endqml
|
||||
|
||||
\section3 Missing Import Statement
|
||||
\section3 Missing import statement
|
||||
|
||||
\qml
|
||||
|
||||
Item { // not ok: must be imported from QtQuick first
|
||||
}
|
||||
\endqml
|
||||
You can fix this warning by adding the missing module import:
|
||||
To fix this warning, add the missing module import:
|
||||
\qml
|
||||
import QtQuick
|
||||
|
||||
|
@ -116,7 +110,7 @@ Item { // ok: was imported from QtQuick
|
|||
}
|
||||
\endqml
|
||||
|
||||
\section1 Import Qualifier must start with a capital letter
|
||||
\section1 Import qualifier must start with a capital letter
|
||||
|
||||
\section2 What happened?
|
||||
Some imported module has an invalid qualifier.
|
||||
|
@ -132,7 +126,7 @@ import QtQuick as qq
|
|||
qq.Item {
|
||||
}
|
||||
\endqml
|
||||
You can fix this warning by making the import qualifier start with an upper case letter:
|
||||
To fix this warning, make the import qualifier start with an upper case letter:
|
||||
\qml
|
||||
import QtQuick as Qq
|
||||
|
||||
|
@ -140,7 +134,7 @@ Qq.Item {
|
|||
}
|
||||
\endqml
|
||||
|
||||
\section1 Unknown Import Syntax
|
||||
\section1 Unknown import syntax
|
||||
|
||||
\section2 What happened?
|
||||
An import statement is using an invalid \l{Import Statements}{import syntax}.
|
||||
|
@ -157,7 +151,7 @@ import QtQuick
|
|||
Item {
|
||||
}
|
||||
\endqml
|
||||
You can fix this warning by using URLs that have an allowed scheme:
|
||||
To fix this warning, use URLs that have an allowed scheme:
|
||||
\qml
|
||||
import "qrc:/path/to/Module"
|
||||
import QtQuick
|
||||
|
|
|
@ -5,10 +5,12 @@
|
|||
\page qmllint-warnings-and-errors-inheritance-cycle.html
|
||||
\ingroup qmllint-warnings-and-errors
|
||||
|
||||
\title Inheritance Cycle
|
||||
\title Inheritance cycle
|
||||
\brief A component inherits from itself.
|
||||
|
||||
\section1 Component Is Part Of An Inheritance Cycle
|
||||
\qmllintwarningcategory inheritance-cycle
|
||||
|
||||
\section1 Component is part of an inheritance cycle
|
||||
|
||||
\section2 What happened?
|
||||
A component inherited directly or indirectly from itself.
|
||||
|
@ -32,7 +34,7 @@ Item {
|
|||
component C2: C{}
|
||||
}
|
||||
\endqml
|
||||
You can fix this warning by breaking up the inheritance cycle
|
||||
To fix this warning, break up the inheritance cycle:
|
||||
\qml
|
||||
import QtQuick
|
||||
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
\title Invalid qmllint directives
|
||||
\brief Invalid qmllint comments.
|
||||
|
||||
\qmllintwarningcategory invalid-lint-directive
|
||||
|
||||
\section1 Invalid qmllint directive provided
|
||||
|
||||
\section2 What happened?
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
\title Missing enum entry
|
||||
\brief Enum value is missing from its declaration.
|
||||
|
||||
\qmllintwarningcategory missing-enum-entry
|
||||
|
||||
\section1 Is not an entry of enum
|
||||
|
||||
\section2 What happened?
|
||||
|
|
|
@ -8,12 +8,7 @@
|
|||
\title Missing property
|
||||
\brief Binding a value to a non-existing property.
|
||||
|
||||
This category has multiple warnings:
|
||||
\list
|
||||
\li \l{Can't assign to non-existent default property}
|
||||
\li \l{Property does not exist}
|
||||
\li \l{Member not found on type}
|
||||
\endlist
|
||||
\qmllintwarningcategory missing-property
|
||||
|
||||
\section1 Can't assign to non-existent default property
|
||||
|
||||
|
|
|
@ -5,16 +5,12 @@
|
|||
\page qmllint-warnings-and-errors-missing-type.html
|
||||
\ingroup qmllint-warnings-and-errors
|
||||
|
||||
\title Missing Type
|
||||
\title Missing type
|
||||
\brief A type used in a binding or alias was not found.
|
||||
|
||||
This warning category has multiple warnings:
|
||||
\list
|
||||
\li \l{Cannot Deduce Type of Alias}
|
||||
\li \l{No Type Found For Property}
|
||||
\endlist
|
||||
\qmllintwarningcategory missing-type
|
||||
|
||||
\section1 Cannot Deduce Type of Alias
|
||||
\section1 Cannot deduce type of alias
|
||||
|
||||
\section2 What happened?
|
||||
An alias property points to a property with a C++ type whose QML counterpart was not found. This can
|
||||
|
@ -108,7 +104,7 @@ in your QML file. This is because the same type can be exposed multiple times wi
|
|||
attributes in different modules: \c{mymodule} actually has to be precise about the QML type of
|
||||
\c{myProperty}.
|
||||
|
||||
You can fix this warning by adding the dependency in the \c{CMakeLists.txt}:
|
||||
To fix this warning, add the dependency in the \c{CMakeLists.txt}:
|
||||
\badcode
|
||||
qt_add_qml_module(mymodule
|
||||
URI mymodule
|
||||
|
@ -123,7 +119,7 @@ Now, the warning should be gone!
|
|||
|
||||
\b {See also} \l {Declaring module dependencies}.
|
||||
|
||||
\section1 No Type Found For Property
|
||||
\section1 No type found for property
|
||||
|
||||
\section2 What happened?
|
||||
A binding was set on a property whose QML type was not found. This can be caused by a QML module
|
||||
|
@ -222,7 +218,7 @@ The reason for the warning message is that in the QML code, the type \c{QQuickIt
|
|||
and its QML counterpart \c{Item} are not known: the dependency 'QtQuick' of mymodule was not
|
||||
declared in the \c{CMakeLists.txt}.
|
||||
|
||||
You can fix this warning by adding the dependency in the \c{CMakeLists.txt}:
|
||||
To fix this warning, add the dependency in the \c{CMakeLists.txt}:
|
||||
\badcode
|
||||
qt_add_qml_module(mymodule
|
||||
URI mymodule
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
\title Multiline strings
|
||||
\brief A string is spanning over multiple lines.
|
||||
|
||||
\qmllintwarningcategory multiline-strings
|
||||
|
||||
\section1 String contains unescaped line terminator, which is deprecated
|
||||
|
||||
\section2 What happened?
|
||||
|
|
|
@ -5,10 +5,12 @@
|
|||
\page qmllint-warnings-and-errors-non-list-property.html
|
||||
\ingroup qmllint-warnings-and-errors
|
||||
|
||||
\title Non-List Property
|
||||
\title Non-list property
|
||||
\brief Multiple values were assigned to a non-list property.
|
||||
|
||||
\section1 Cannot Assign Multiple Objects To A Default Non-List Property
|
||||
\qmllintwarningcategory non-list-property
|
||||
|
||||
\section1 Cannot assign multiple objects to a default non-list property
|
||||
|
||||
\section2 What happened?
|
||||
A \l{Default Properties}{default property} has multiple bindings but the default
|
||||
|
@ -43,7 +45,7 @@ Item {
|
|||
}
|
||||
|
||||
\endqml
|
||||
You can fix this warning by replacing the default property by a list:
|
||||
To fix this warning, replace the default property by a list:
|
||||
\qml
|
||||
import QtQuick
|
||||
|
||||
|
@ -61,7 +63,7 @@ Item {
|
|||
}
|
||||
}
|
||||
\endqml
|
||||
You can also fix this warning by removing all the unwanted bindings, in case the default property
|
||||
To fix this warning, remove all the unwanted bindings in case the default property
|
||||
is not supposed to be a list:
|
||||
\qml
|
||||
import QtQuick
|
||||
|
|
|
@ -5,10 +5,12 @@
|
|||
\page qmllint-warnings-and-errors-read-only-property.html
|
||||
\ingroup qmllint-warnings-and-errors
|
||||
|
||||
\title Readonly Property
|
||||
\title Readonly property
|
||||
\brief A readonly property was written.
|
||||
|
||||
\section1 Cannot Assign To Read-Only Property
|
||||
\qmllintwarningcategory read-only-property
|
||||
|
||||
\section1 Cannot assign to read-only property
|
||||
|
||||
\section2 What happened?
|
||||
A \l{Read-Only Properties}{read-only property} was written.
|
||||
|
@ -29,10 +31,9 @@ Item {
|
|||
}
|
||||
}
|
||||
\endqml
|
||||
You can fix this warning by removing the write to the read-only property, by writing to another
|
||||
non-read-only property, or by removing the readonly modifier if the property should no longer be
|
||||
considered constant.
|
||||
|
||||
To fix this warning, remove the write to the read-only property, write to another
|
||||
non-read-only property, or remove the readonly modifier if you are the author of
|
||||
the property definition.
|
||||
\sa{Read-Only Properties}
|
||||
*/
|
||||
|
||||
|
|
|
@ -5,10 +5,12 @@
|
|||
\page qmllint-warnings-and-errors-recursion-depth-errors.html
|
||||
\ingroup qmllint-warnings-and-errors
|
||||
|
||||
\title Recursion Depths Errors
|
||||
\title Recursion depths errors
|
||||
\brief Qml statement or expression is too deeply nested.
|
||||
|
||||
\section1 Maximum Statement Or Expression Depth Exceeded
|
||||
\qmllintwarningcategory recursion-depth-errors
|
||||
|
||||
\section1 Maximum statement or expression depth exceeded
|
||||
\section2 What happened?
|
||||
A QML statement or expression was too deeply nested for the compiler. This usually only happens for
|
||||
generated code where statements or expressions can be very long, as the recursion limit is usually
|
||||
|
@ -31,9 +33,9 @@ Item {
|
|||
}
|
||||
\endqml
|
||||
|
||||
You can fix this warning by auto-generating smaller code pieces. You could split deeply nested
|
||||
Components in multiple files or inline components, or split deeply nested expressions into multiple
|
||||
expressions:
|
||||
To fix this warning, auto-generate smaller code pieces. Split deeply nested
|
||||
Components in multiple files or inline components, or split deeply nested
|
||||
expressions into multiple expressions:
|
||||
\qml
|
||||
import QtQuick
|
||||
|
||||
|
|
|
@ -5,10 +5,12 @@
|
|||
\page qmllint-warnings-and-errors-required.html
|
||||
\ingroup qmllint-warnings-and-errors
|
||||
|
||||
\title Component is Missing a Required Property
|
||||
\title Component is missing a required property
|
||||
\brief A component's required property was not bound.
|
||||
|
||||
\section1 Component is Missing a Required Property
|
||||
\qmllintwarningcategory required
|
||||
|
||||
\section1 Component is missing a required property
|
||||
|
||||
\section2 What happened?
|
||||
The \l{QML Object Attributes#required-properties}{required property} of a component was not set.
|
||||
|
@ -37,7 +39,7 @@ Item {
|
|||
}
|
||||
}
|
||||
\endqml
|
||||
You can fix this warning by setting the required properties
|
||||
To fix this warning, set the required properties:
|
||||
\qml
|
||||
import QtQuick
|
||||
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
\title Restricted type
|
||||
\brief A restricted type was accessed.
|
||||
|
||||
\qmllintwarningcategory restricted-type
|
||||
|
||||
\section1 You can't access an unscoped enum from here
|
||||
|
||||
\section2 What happened?
|
||||
|
|
|
@ -5,12 +5,14 @@
|
|||
\page qmllint-warnings-and-errors-signal-handler-parameters.html
|
||||
\ingroup qmllint-warnings-and-errors
|
||||
|
||||
\title Signal Handler Parameters
|
||||
\title Signal handler parameters
|
||||
\brief The signal handler does not satisfy the signal types.
|
||||
|
||||
\qmllintwarningcategory signal-handler-parameters
|
||||
|
||||
This warning category has multiple warnings, described in the sections below:
|
||||
|
||||
\section1 Type Of Parameter In Signal Was Not Found
|
||||
\section1 Type of parameter in signal was not found
|
||||
|
||||
\section2 What happened?
|
||||
A signal handler tried to handle a signal with parameters of unknown QML types.
|
||||
|
@ -115,7 +117,7 @@ Now, the QML code should be fine again!
|
|||
\omit
|
||||
TODO: QML Lint cannot detect if you pass signal parameters by value, reference or pointer!
|
||||
Therefore, it will never print that warning.
|
||||
\section1 Type Of Parameter In Signal Should Be Passed By Pointer
|
||||
\section1 Type of parameter in signal should be passed by pointer
|
||||
\section2 What happened?
|
||||
TODO
|
||||
|
||||
|
@ -132,7 +134,7 @@ You can fix this warning by TODO
|
|||
TODO: QML Lint cannot detect if you pass signal parameters by value, reference or pointer!
|
||||
Therefore, it will never print that warning.
|
||||
that warning
|
||||
\section1 Type Of Parameter In Signal Should Be Passed By Value Or Const Reference
|
||||
\section1 Type of parameter in signal should be passed by value or const reference
|
||||
\section2 What happened?
|
||||
TODO
|
||||
|
||||
|
@ -148,7 +150,7 @@ You can fix this warning by TODO
|
|||
|
||||
\endomit
|
||||
|
||||
\section1 Signal Handler Has More Formal Parameters Than The Signal It Handles
|
||||
\section1 Signal handler has more formal parameters than the signal it handles
|
||||
\section2 What happened?
|
||||
A signal handler expects more parameters than what the signal will actually provide.
|
||||
|
||||
|
@ -165,7 +167,8 @@ Item {
|
|||
onHelloWorld: function (x,y,z) {} // not ok: signal handler handles three parameters
|
||||
}
|
||||
\endqml
|
||||
You can fix this warning by removing the extra parameters of the signal handler:
|
||||
To fix this warning, remove the extra parameters of the signal handler or
|
||||
add the missing parameters to the signal's declaration:
|
||||
\qml
|
||||
import QtQuick
|
||||
|
||||
|
@ -173,21 +176,14 @@ Item {
|
|||
signal helloWorld(x: QtObject) // signal expects only one parameter
|
||||
|
||||
onHelloWorld: function (x) {} // ok: signal handler handles one parameter
|
||||
|
||||
signal alternativeHelloWorld(x: QtObject, y: int, y: int) // signal expects three parameters
|
||||
|
||||
onAlternativeHelloWorld: function (x,y,z) {} // ok: signal handler handles three parameters
|
||||
}
|
||||
\endqml
|
||||
|
||||
It can also be fixed by adding the missing parameters to the signal's declaration:
|
||||
\qml
|
||||
import QtQuick
|
||||
|
||||
Item {
|
||||
signal helloWorld(x: QtObject, y: int, y: int) // signal expects three parameters
|
||||
|
||||
onHelloWorld: function (x,y,z) {} // ok: signal handler handles three parameters
|
||||
}
|
||||
\endqml
|
||||
|
||||
\section1 The Signal Has A Parameter Of The Same Name
|
||||
\section1 The signal has a parameter of the same name
|
||||
\section2 What happened?
|
||||
The signal or signal handler might have swapped some of its arguments, or some arguments might be
|
||||
missing.
|
||||
|
@ -207,7 +203,7 @@ Item {
|
|||
}
|
||||
|
||||
\endqml
|
||||
You can fix this warning by adding the missing parameters:
|
||||
To fix this warning, add the missing parameters or rename the first parameter:
|
||||
\qml
|
||||
import QtQuick
|
||||
|
||||
|
@ -215,20 +211,14 @@ Item {
|
|||
signal helloWorld(x: QtObject, y: int)
|
||||
|
||||
onHelloWorld: function (x, y) {} // ok: parameters have the same order as in helloWorld
|
||||
}
|
||||
\endqml
|
||||
or by renaming the first parameter:
|
||||
\qml
|
||||
import QtQuick
|
||||
|
||||
Item {
|
||||
signal helloWorld(x: QtObject, y: int)
|
||||
signal alternativeHelloWorld(x: QtObject, y: int)
|
||||
|
||||
onHelloWorld: function (x) {} // ok: parameters have the same order as in helloWorld, even if y is missing
|
||||
onAlternativeHelloWorld: function (x) {} // ok: parameters have the same order as in helloWorld, even if y is missing
|
||||
}
|
||||
\endqml
|
||||
|
||||
\section3 Swapped Arguments
|
||||
\section3 Swapped arguments
|
||||
\qml
|
||||
import QtQuick
|
||||
|
||||
|
@ -239,7 +229,7 @@ Item {
|
|||
}
|
||||
|
||||
\endqml
|
||||
You can fix this warning by reordering the parameters in the correct order
|
||||
To fix this warning, reorder the parameters in the correct order:
|
||||
\qml
|
||||
import QtQuick
|
||||
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
\title Duplicate id
|
||||
\brief An id is not unique.
|
||||
|
||||
\qmllintwarningcategory syntax.duplicate-ids
|
||||
|
||||
\section1 Found a duplicated id
|
||||
|
||||
\section2 What happened?
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
\title Id quotation
|
||||
\brief Id has quotation marks.
|
||||
|
||||
\qmllintwarningcategory syntax.id-quotation
|
||||
|
||||
\section1 Ids do not need quotation marks
|
||||
|
||||
\section2 What happened?
|
||||
|
|
|
@ -8,18 +8,7 @@
|
|||
\title Syntax
|
||||
\brief Various syntactic errors.
|
||||
|
||||
This warning category has multiple warnings:
|
||||
\list
|
||||
\li \l{Nested inline components are not supported}
|
||||
\li \l{Inline component declaration must be followed by a typename}
|
||||
\li \l{Invalid alias expression: an initializer is needed}
|
||||
\li \l{Invalid alias expression: only ids and field member expressions can be aliased}
|
||||
\li \l{Id must be followed by an identifier}
|
||||
\li \l{Failed to parse id}
|
||||
\li \l{Declaring an object which is not a QML object as a list member}
|
||||
\li \l{Enums declared inside of inline components are ignored}
|
||||
\li \l{Unknown argument to pragma}
|
||||
\endlist
|
||||
\qmllintwarningcategory syntax
|
||||
|
||||
\section1 Nested inline components are not supported
|
||||
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
\title Top level component
|
||||
\brief Root QML type is a component
|
||||
|
||||
\qmllintwarningcategory top-level-component
|
||||
|
||||
\section1 QML top level type can't be \e Component
|
||||
|
||||
\section2 What happened?
|
||||
|
|
|
@ -8,13 +8,7 @@
|
|||
\title Uncreatable type
|
||||
\brief Types that can't be created.
|
||||
|
||||
This warning category has multiple warnings:
|
||||
\list
|
||||
\li \l{Namespace must start with an upper case letter}
|
||||
\li \l{Singleton type is not creatable}
|
||||
\li \l{Type is not creatable}
|
||||
\endlist
|
||||
|
||||
\qmllintwarningcategory uncreatable-type
|
||||
|
||||
\section1 Namespace must start with an upper case letter
|
||||
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
\title Unqualified
|
||||
\brief Accessing an outer scope without its id.
|
||||
|
||||
\qmllintwarningcategory unqualified
|
||||
|
||||
\section1 Unqualified access
|
||||
|
||||
\section2 What happened?
|
||||
|
|
|
@ -5,10 +5,12 @@
|
|||
\page qmllint-warnings-and-errors-unresolved-alias.html
|
||||
\ingroup qmllint-warnings-and-errors
|
||||
|
||||
\title Unresolved Alias
|
||||
\title Unresolved alias
|
||||
\brief Property of property alias was not found.
|
||||
|
||||
\section1 Unresolved Alias
|
||||
\qmllintwarningcategory unresolved-alias
|
||||
|
||||
\section1 Unresolved alias
|
||||
|
||||
\section2 What happened?
|
||||
A property alias should hold a reference to another property, see also
|
||||
|
@ -33,7 +35,7 @@ Item {
|
|||
}
|
||||
|
||||
\endqml
|
||||
You can fix this warning by making sure that the id and the properties of the alias property
|
||||
To fix this warning, make sure that the id and the property of the alias property
|
||||
really do exist:
|
||||
\qml
|
||||
import QtQuick
|
||||
|
|
|
@ -22,11 +22,7 @@ This category contains following warnings:
|
|||
These warnings usually indicate missing imports or faulty QML modules, depending
|
||||
on whether you are using or writing a QML module.
|
||||
|
||||
This page is split in two parts:
|
||||
\list
|
||||
\li \l{For QML module users}
|
||||
\li \l{For QML module authors}
|
||||
\endlist
|
||||
\qmllintwarningcategory unresolved-type
|
||||
|
||||
\section1 For QML module users
|
||||
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
\title Unused imports
|
||||
\brief Types of the imported module were not used.
|
||||
|
||||
\qmllintwarningcategory unused-imports
|
||||
|
||||
\section1 Unused import
|
||||
|
||||
\section2 What happened?
|
||||
|
|
|
@ -8,15 +8,7 @@
|
|||
\title Use proper function
|
||||
\brief Calling something that might not be a function.
|
||||
|
||||
This warning category has multiple warnings:
|
||||
\list
|
||||
\li \l{Property is a variant property: It may or may not be a method}
|
||||
\li \l{Property is a QJSValue property: It may or may not be a method}
|
||||
\li \l{Signal is shadowed by a property}
|
||||
\li \l{Method is shadowed by a property}
|
||||
\li \l{Slot is shadowed by a property}
|
||||
\li \l{Property is not a method}
|
||||
\endlist
|
||||
\qmllintwarningcategory use-proper-function
|
||||
|
||||
\section1 Property is a variant property: It may or may not be a method
|
||||
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
\title Var used before declaration
|
||||
\brief A JavaScript variable was used before its declaration.
|
||||
|
||||
\qmllintwarningcategory var-used-before-declaration
|
||||
|
||||
\section1 Variable is used here before its declaration
|
||||
|
||||
\section2 What happened?
|
||||
|
|
|
@ -5,10 +5,12 @@
|
|||
\page qmllint-warnings-and-errors-with.html
|
||||
\ingroup qmllint-warnings-and-errors
|
||||
|
||||
\title With Statements
|
||||
\title With
|
||||
\brief With statements are strongly discouraged in QML.
|
||||
|
||||
\section1 With Statements
|
||||
\qmllintwarningcategory with
|
||||
|
||||
\section1 With statements
|
||||
|
||||
\section2 What happened?
|
||||
The JavaScript \c{with} statement was used.
|
||||
|
@ -30,8 +32,7 @@ Item {
|
|||
}
|
||||
}
|
||||
\endqml
|
||||
You can fix this warning by replacing the \c{with} statement with a destructuring property,
|
||||
for example:
|
||||
To fix this warning, replace the \c{with} statement with a destructuring property:
|
||||
\qml
|
||||
import QtQuick
|
||||
|
||||
|
|
Loading…
Reference in New Issue