Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qdoc-warnings.qdoc
Go to the documentation of this file.
1
// Copyright (C) 2021 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4
/*!
5
\page qdoc-warnings.html
6
\previouspage Categories of Documentation
7
8
\title Troubleshooting QDoc Warnings
9
10
QDoc may issue warnings when generating your documentation set.
11
This section describes what these warnings mean and how to resolve
12
them. This document does not describe warnings generated by Clang.
13
14
\section1 All properties in a group must belong to the same type: <name>
15
16
When documenting QML property groups, all properties listed in
17
the comment block must belong to the same QML type.
18
19
\section1 Already generated <file> for this project
20
21
While generating the documentation for a project, QDoc keeps track of the
22
file names of the files it has generated. QDoc will issue a warning when it
23
opens a file for writing if that file is known to have been generated
24
previously, in the current execution. This can happen if a \qdoccmd page
25
command uses the same name as \qdoccmd group, for example.
26
27
You can set the environment variable \c QDOC_ALL_OVERWRITES_ARE_WARNINGS to
28
unconditionally warn about all such events. This may be useful when tracking
29
down the offending definitions.
30
31
\section1 \\brief statement does not end with a full stop
32
33
The argument to the \\brief command is a sentence, summarizing
34
the topic documented, so should end in a full stop. It should
35
also be brief.
36
37
\section1 Can't link to <target>
38
39
QDoc issues this warning when one part of the documentation
40
(identified in the warning message) tries to refer to another,
41
but doesn't correctly specify that other, the target of the link.
42
This may arise because the reference to it is mistyped or because
43
the target has changed name (for a function or type) or title
44
(for another section).
45
46
This can have a variety of causes:
47
48
\list
49
\li The link target has not been defined with a QDoc topic command,
50
e.g. {title-command}{\\title} <target>.
51
\li The <target> contains a typo.
52
\li The document that contains that link target did not get compiled.
53
\li The document that contains that link target is in a module that is
54
not in the compilation path.
55
\li The link target is in another module, and a dependency to that
56
module was not set in the configuration or QDoc failed to locate
57
the index file for the dependency.
58
\endlist
59
60
Search the source code for that particular link target. If you get no
61
results, gradually make the search less specific until you find a match.
62
63
If the link target looks like the name of a type or function,
64
this could also be due to:
65
66
\list
67
\li The name (or, for functions, where specified, signature) used
68
where it is documented not matching the name used in its
69
declaration.
70
\li The link target being marked as \l {internal-command}{\\internal} when the linking
71
text was not.
72
\endlist
73
74
\section1 Cannot find base function for <method> in <class>
75
76
QDoc produces this warning if \\reimp is used to document a method,
77
as an override of a virtual method, when no base class has a virtual
78
method with the given name and signature. This may happen because
79
the method it was written to override has changed its signature, or is
80
no longer virtual.
81
82
\section1 Cannot find <name> specified with \<command> in any header file
83
84
This means that QDoc cannot find a declaration of <name> in any
85
header file, but has found a comment that claims to document it.
86
87
An example:
88
\badcode
89
Cannot find 'Color::Red' specified with '\enum' in any header file.
90
\endcode
91
92
A documentation comment claims to describe an enum, but QDoc didn't
93
find a definition of that enum in a header file.
94
95
This may also be due to:
96
97
\list
98
\li a typo in <name> or <command>
99
\li a missing namespace-or-class prefix
100
\li <name> having moved to another namespace or class
101
\endlist
102
103
\section1 Cannot find project file for example <name>
104
105
In the example's source directory, QDoc expects to find a project
106
file named \c{CMakeLists.txt}, or a file with a \c{.pro}, \c{.qmlproject}, or
107
\c{.pyproject} extension where the base name matches that of the example
108
directory. For example, \c {examples/mymodule/helloworld/helloworld.pro}.
109
110
\section1 Cannot find snippets file to quote from
111
112
QDoc issues this warning if it is unable to find the file named
113
after a \l {snippet-command}{\\snippet} or \l {quotefromfile-command}{\\quotefromfile} command.
114
115
Some useful steps for correcting this:
116
117
\list
118
\li Check if the snippet file name is correct. QDoc appends the
119
snippet file name to each of the directories given in the
120
search path, to get a path-name for a candidate file to look
121
for. It produces this error when none of these candidates exist.
122
\li Check the search path for snippets, given by the \c exampledirs
123
configuration variable in the \c{*.qdocconf} file. You may need
124
to add an entry to this path, or correct an existing entry.
125
\li Check if the snippet file exists, or if it has been moved, renamed
126
or removed, which may happen when there are changes to the source
127
code that QDoc tries to quote from.
128
\endlist
129
130
\section1 Cannot find qdoc include file <filename>
131
132
QDoc failed to find an include file named in a command.
133
QDoc searches each directory named in the search path.
134
If there is no file with this name in any of those directories,
135
or the file found in that search is not readable, QDoc issues
136
this warning. Check that the combination of search path and
137
<filename> is correctly spelled, and that you have read permissions
138
for the file.
139
140
\note <filename> may include a directory name prefix; the whole
141
<filename> is appended to each directory in the search path.
142
143
\sa {Cannot open file to quote from: <filename>}
144
145
\section1 Cannot find <tag> in <file>
146
147
This means QDoc cannot find the identifier <id> in the
148
\l{include-command}{\\include} <file> or {snippet-command}{\\snippet} <file>.
149
150
\section1 Cannot locate index file for dependency <depend>
151
152
Example:
153
154
\badcode
155
"QMake" Cannot locate index file for dependency "activeqt"
156
\endcode
157
158
The documentation project QMake could not locate activeqt.index
159
in any of the specified index directories. In this case, the
160
specified index directories are specified in qmake.qdocconf.
161
162
\section1 Cannot nest <command> commands
163
164
This warning concerns formatting commands: bold, italic,
165
index, link, span, subscript, superscript, teletype, uicontrol,
166
underline. A formatting command cannot be used within the text
167
it applies to. An example of this:
168
169
\badcode
170
There is \b{no \b{super-}bold}.
171
\encode
172
173
\section1 Can't use <inner> in <outer>
174
175
This warning is issued for commands that cannot be nested.
176
177
Example:
178
\badcode
179
\list
180
\li \table
181
\row \li Hello \li Hi
182
\endtable
183
\endlist
184
\endcode
185
186
Results in the QDoc warning "Can't use '\\table' in '\\list'".
187
188
\section1 Cannot open file to quote from: <filename>
189
190
The search path for <filename> is defined by the following
191
variables in the \c{.qdocconf} file: \c{sources}, \c{sourcedirs},
192
and \c{exampledirs}.
193
194
QDoc failed to find a file named in a command (such as
195
\l {quotefromfile-command}{\\quotefromfile},
196
\l {snippet-command}{\\snippet}, \l {include-command}{\\include})
197
that tells it to retrieve content from the named file. It searches
198
each directory named in the search path. If there is no file with
199
this name in any of those directories, or the file is found but not
200
readable, QDoc issues this warning. Check that the combination of
201
search path and <filename> is correctly spelled, and that you have
202
read permissions for the file.
203
204
\note <filename> may include a directory name prefix; the whole
205
<filename> is appended to each directory in the search path.
206
207
\sa {Cannot find qdoc include file <filename>}
208
209
\section1 Cannot tie this documentation to anything
210
211
QDoc found a \beginqdoc ... \endqdoc comment, with no \l{Topic Commands}{topic command}, and
212
could not associate the declaration or definition immediately following the
213
comment with a documented entity. This can happen if there's no declaration
214
or definition following the comment, or if the entity isn't visible to QDoc,
215
such as when the declaration is behind a preprocessor conditional that QDoc
216
doesn't evaluate.
217
218
\section1 <class> tries to inherit itself
219
220
The \l {inherits-command}{\\inherits} command is used to document that a QMl type
221
inherits some other QML type. This warning is issued if that other
222
QML type is the same as the QML type documented.
223
224
Example:
225
226
\badcode
227
\qmltype Foo
228
\inherits Foo
229
\endcode
230
231
\section1 Command <command> failed at end of file <filename>
232
233
Example:
234
235
\badcode
236
Command "\snippet (//! [2]) failed at end of file qmlbars/qml/qmlbars/main.qml".
237
\endcode
238
239
In this case the warning means that the \l {snippet-command}{\\snippet} command did not find a second
240
label "\/\/! [2]" to mark the end of the snippet. It could also mean that it didn't
241
find any occurrence of that snippet tag in this snippet file.
242
243
Another example:
244
245
\badcode
246
Command '\skipto' failed at end of file 'styling/CMakeLists.txt".
247
\endcode
248
249
The \l {skipto-command}{\\skipto} + <pattern> moves the cursor to the next line containing
250
that pattern. If \\skipto doesn't find it, QDoc issues this warning.
251
252
\section1 Command <command> not allowed with QML property commands
253
254
Example:
255
256
\badcode
257
\qmlproperty real QtQuick.Controls::RangeSlider::first.value
258
\qmlproperty real QtQuick.Controls::RangeSlider::first.position
259
\qmlproperty real QtQuick.Controls::RangeSlider::first.visualPosition
260
\qmlsignal void QtQuick.Controls::RangeSlider::first.moved()
261
\qmlsignal void QtQuick.Controls::RangeSlider::second.moved()
262
\endcode
263
264
Error message:
265
266
\badcode
267
Command '\\qmlsignal' not allowed with QML property commands
268
\endcode
269
270
This warning is specific to property group documentation. QDoc
271
allows multiple qmlproperty or qmlattachedproperty topic commands
272
in a single documentation comment to document a property group
273
where the last element in the path is <group>.<property>. Any other topic
274
commands triggers this warning.
275
276
\section1 Could not resolve QML import statement for type <name>
277
278
QDoc issues this warning if you document a QML type, but omit
279
the \l{inqmlmodule-command}{\\inqmlmodule} command.
280
Example:
281
282
\badcode
283
Could not resolve QML import statement for type 'ItemSelectionModel'
284
\encode
285
286
Incorrect:
287
\badcode
288
\qmltype ItemSelectionModel
289
\nativetype QItemSelectionModel
290
\since 5.5
291
\ingroup qtquick-models
292
\endcode
293
Correct:
294
\badcode
295
\qmltype ItemSelectionModel
296
\nativetype QItemSelectionModel
297
\inqmlmodule QtQml.Models
298
\since 5.5
299
\ingroup qtquick-models
300
\endcode
301
302
\section1 Cyclic type inheritance: <type>
303
304
Cyclic or circular inheritance occurs when a QML type inherits from a base
305
type that itself inherits from the original type. This can occur between
306
two mutually inheriting types, or there may be intermediate types between
307
them.
308
309
This warning indicates where a cycle in the inheritance hierarchy has been
310
detected. You should examine the \l {inherits-command}{\\inherits} command
311
for the type and follow the trail of base types until one is found that
312
inherits from a type that you have previously encountered. You should then
313
break the cycle by fixing the incorrect \l {inherits-command}{\\inherits}
314
command for one of the identified types.
315
316
\section1 Dependent modules specified, but no index directories were set.
317
318
QDoc expected to see one or more --indexdir arguments on the command line.
319
Without them, QDoc cannot locate the index files of any dependencies
320
defined with the 'depends' configuration variable.
321
322
\section1 Documentation configuration for <project> doesn't define a help project (qhp)
323
324
A valid Qt help configuration was expected but not provided in the project's
325
.qdocconf file.
326
327
See also \l{Creating Help Project Files} and \l {qhp-variable}{qhp}.
328
329
\section1 Duplicate target name <target>
330
331
This warning is issued if you define two targets with the same parameter,
332
using either the \l {target-command}{\\target} or the \l {keyword-command}
333
{\\keyword} command. The target name given as parameter to these commands
334
must be unique. The warning is followed by "The previous occurrence is
335
here: [location]", where location contains a file name and line number.
336
337
\section1 Empty qdoc snippet <tag> in <file>
338
339
The snippet <tag> was found in the \l {snippet-command}{\\snippet} <file>, but it is empty.
340
341
\section1 Failed to find function when parsing \\fn <signature>
342
343
QDoc cannot resolve the signature following an \qdoccmd fn command
344
to a function declared in the project's headers. This warning also
345
applies when the signature is valid C++ but names no matching function.
346
347
Check the function's namespace or class scope, template arguments,
348
parameter types, and qualifiers such as \e const.
349
350
\note A \e {hidden friend} can be documented using either the
351
class-qualified syntax or the unqualified free function
352
syntax with its return type. For a non-template hidden friend
353
in a class template, the unqualified convention described by
354
\l{fn-command}{\\fn} must have a unique supported match.
355
Unsupported template contexts and ambiguous matches produce
356
this warning too.
357
358
\section1 Failed to find qhp.<project>.subprojects.<subproject>.indexTitle
359
360
QDoc failed to find a title for a page designated as the index page
361
for <subproject> in the Qt help project configuration.
362
363
Subproject index titles must be local to the current documentation project.
364
Using a page title from another project, loaded as a dependency, also
365
results in this warning.
366
367
For more information, see \l {Creating Help Project Files}.
368
369
\section1 Failed to open <file> for writing
370
371
This warning clearly means it cannot open a file for writing, probably because
372
of a wrong path, or permission to write in a certain directory.
373
374
\section1 Found a \\target command outside table item in a table
375
376
If QDoc encounters a \l {target-command}{\\target command} that is not
377
preceded by an \\li command within a \l {table-command}
378
{\\table ... \\endtable block}, it issues this warning. The warning is
379
followed by the text
380
\e {Move the \\target inside the \\li to resolve this warning}.
381
382
\section1 \\generatelist <group> is empty
383
384
Below a short overview of all possible arguments for \l {generatelist-command}{\\generatelist}:
385
\list
386
\li \\generatelist annotatedexamples
387
\li \\generatelist annotatedattributions
388
\li \\generatelist classes <prefix>
389
\li \\generatelist classesbymodule <module name>
390
\li \\generatelist qmltypesbymodule <module name>
391
\li \\generatelist functionindex
392
\li \\generatelist legalese
393
\li \\generatelist overviews
394
\li \\generatelist attributions
395
\li \\generatelist related
396
\endlist
397
398
QDoc issues this warning if you specify \c{\generatelist <group>}
399
and the group does not contain any items, or if you specify
400
\c{\generatelist <group> <pattern>} and no item in the group
401
matches the pattern.
402
403
\section1 \\generatelist <group> no such group
404
405
This warning issues if the argument to \l {generatelist-command}{\\generatelist}
406
is a non-existing group.
407
408
Example:
409
410
\code
411
\generatelist draganddrop
412
\endcode
413
414
This statement generates a list of classes or QML types in the
415
draganddrop group. Classes or QML types are added to the
416
draganddrop group by the \c{\l {ingroup-command}{\ingroup} draganddrop} command in their
417
\l {class-command}{\\class} or \l {qmltype-command}{\\qmltype} comment.
418
419
QDoc issues this warning message if no entity has
420
this \c{\ingroup draganddrop} statement.
421
422
\section1 Has no \\inmodule command
423
424
QDoc issues this warning if the QDoc comments do not relate
425
a class, namespace, or headerfile to a module with the
426
\l{inmodule-command}{\\inmodule} command.
427
428
If the QDoc comment describes an entity that's not a member of
429
some other entity (typically a namespace or class), it should use
430
either \l {relates-command}{\\relates} or \l {inmodule-command}{\\inmodule}
431
to associate it with its broader context. This warning is raised
432
if it does not.
433
434
\section1 Illegal \\reimp; no documented virtual function for <command>
435
436
Qdoc tries to create a link to the function that this one reimplements,
437
but it could not find the link target, likely because that
438
function is not documented. This can also arise if no base class
439
has a virtual method with this name and signature; which might
440
arise due to a renaming, a change in signature or the base no
441
longer declaring it virtual.
442
443
\section1 Invalid QML property type
444
445
The type used to declare a QML property was not a valid
446
\l{QML Value Types}{QML value type} or \l{QML Object Types}{QML object type},
447
or it was a C++ or Qt type.
448
449
This warning typically occurs when developers refer to the underlying Qt
450
type used to implement a QML type, such as QStringList instead of
451
\c{list<string>}.
452
453
\section1 Invalid regular expression <regex>
454
455
Some QDoc commands take regular expressions as parameters. QDoc
456
gives this warning when the text given as such a parameter is not
457
a valid regular expression, usually due to it containing characters
458
with special meanings in regular expressions, that should have been
459
escaped.
460
461
Example:
462
463
\badcode
464
notifications.qdoc:56: (qdoc) warning: Invalid regular expression '^})$'
465
\endcode
466
467
\badcode
468
\quotefromfile webenginewidgets/notifications/data/index.html
469
\skipuntil resetPermission
470
\endcode
471
472
Invalid regular expression:
473
\badcode
474
\printuntil /^})$/
475
\endcode
476
477
Valid regular expression:
478
\badcode
479
\printuntil /^\}\)$/
480
\endcode
481
482
The \l {printuntil-command}{\\printuntil} command prints until it
483
meets a line consisting of only a right curly brace followed by a
484
right parenthesis. In this case, the curly brace and the parenthesis
485
need to be escaped because they have special meanings in regular
486
expressions.
487
488
\section1 Macro cannot have both format-specific and qdoc-syntax definitions
489
490
A \l {macro-variable}{\\macro} that specifies an output format cannot also
491
have a generic definition.
492
493
An example of a configuration that triggers this warning:
494
495
\badcode
496
macro.gui = \b
497
macro.gui.HTML = "<b>\1</b>"
498
\endcode
499
500
\section1 Macro <command> does not have a default definition
501
502
QDoc is attempting to expand a macro, and expects that macro to
503
have a default definition. Some macros may only have format-specific
504
definitions.
505
506
Example:
507
\badcode
508
macro.pi.HTML = "π" # encodes the pi symbol for HTML output format
509
\endcode
510
511
There are however instances where macro expansion requires a
512
format-independent macro. For example, you can have macros in
513
section titles, but they must have default definitions.
514
515
\section1 Macro <macro> invoked with too few arguments (expected <many>, got <few>)
516
517
The given macro needs more parameters than it was given. See
518
the definition of the macro in the configuration for further
519
details.
520
521
\section1 Missing comma in \\sa
522
523
The titles listed for a \l {sa-command}{\\sa} command should be separated
524
from one another with commas.
525
526
\section1 Missing format name after \\raw
527
528
The \l {raw-command}{\\raw} command and the corresponding \l {raw-command}{\\endraw}
529
command delimit a block of raw mark-up language code. The \\raw
530
command must be followed by the format name.
531
532
\section1 Missing image: <imagefile>
533
534
The search path to the image is wrong, or the image file does not exist.
535
536
\section1 Missing <outer> before <inner>
537
538
Some examples:
539
540
\list
541
\li The \l {li-command}{\\li} command can only be used inside a \l {list-command}{\\list}
542
or a \l {row-command}{\\row} of a \l {table-command}{\\table}.
543
\li The \l {row-command}{\\row} and \l {header-command}{\\header} commands can only be
544
used within a \l {table-command}{\\table}.
545
\endlist
546
547
\section1 Missing property type for <name>
548
549
A declaration of a \l {qmlproperty-command}{\\qmlproperty} is missing its property type.
550
551
The \\qmlproperty command expects to be followed by the property type, then the
552
fully-qualified name of the property (i.e. the name ::-joined after the name of the
553
class it belongs to).
554
555
Incorrect:
556
\badcode
557
\qmlproperty MyWidget::count
558
\endcode
559
560
Correct:
561
\badcode
562
\qmlproperty int MyWidget::count
563
\endcode
564
565
\section1 Multiple index files found for dependency <indexfile>:<depend>
566
Using <indexfile> as index file for dependency <depend>
567
568
Multiple \c{-indexdir} paths were passed to QDoc as command line options,
569
and more than one contained an \c{.index} file that matches a dependency.
570
QDoc picks the one with the latest timestamp automatically.
571
572
Typically, this warning indicates that there are build artifacts left
573
from a previous documentation build.
574
575
\section1 Multiple primary overload definitions for <function>
576
577
QDoc issues this warning when multiple functions with the same name are
578
marked with \c{\overload primary}. Only one function in an overload
579
group should be designated as the primary overload.
580
581
The warning includes the function signatures and their source locations
582
to help identify all competing primary overloads. QDoc will determine
583
the actual primary overload using lexicographic comparison (alphabetical
584
ordering of function signatures) among the functions marked as primary.
585
586
To resolve this warning, remove the \c{primary} argument from all but
587
one of the \c{\overload primary} commands in the overload group.
588
589
Example that triggers this warning:
590
591
\badcode *
592
/\1!
593
\overload primary
594
Does something with no parameters.
595
\1/
596
void doSomething();
597
598
/\1!
599
\overload primary
600
Does something with a parameter.
601
\1/
602
void doSomething(int value);
603
\endcode
604
605
Correct approach - only one primary:
606
607
\badcode *
608
/\1!
609
\overload primary
610
Does something with no parameters.
611
\1/
612
void doSomething();
613
614
/\1!
615
\overload doSomething()
616
Does something with a parameter.
617
\1/
618
void doSomething(int value);
619
\endcode
620
621
\section1 <name> documented more than once
622
623
QDoc issues this warning when it finds two comments that
624
document the same item. The location of the previously seen
625
comment is provided in warning details.
626
627
For example, you see this warning when a function has a documentation
628
comment preceding its definition, and a separate \\fn comment
629
elsewhere.
630
631
\section1 <name> is documented, but namespace <namespace> is not documented in any module
632
633
The documentation for \e {<name>} was found, but \e{<name>} is declared
634
under a namespace that is either undocumented or QDoc was unable to
635
locate the documentation for it.
636
637
This can be resolved by either documenting \e{<namespace>}, or if it is
638
already documented in another module, ensure that this module has
639
a dependency to it.
640
641
See also \l {depends-variable}{depends} and \l {indexes-variable}{indexes}.
642
643
\section1 Namespace <name> documented more than once
644
645
This warning means that a documentation set contains two comments
646
containing \l {namespace-command}{\\namespace} commands with the same
647
argument, <name>.
648
649
\section1 \\nativetype is only allowed in \\qmltype
650
651
The \l{nativetype-command}{\\nativetype} command can only be used in a QDoc
652
comment that documents a QML type.
653
654
\section1 No documentation for <name>
655
656
Example:
657
658
\badcode
659
Warning "No documentation for QNativeInterface."
660
\endcode
661
662
QDoc detects the declaration of namespace QNativeInterface in
663
a header file, but does not find a QDoc comment where that
664
namespace has been documented.
665
666
\section1 No documentation generated for function <name> in global scope
667
668
QDoc was able to match the documentation for a function \e {<name>} to its
669
declaration, but no output was generated because the function is declared
670
in the global namespace.
671
672
Use the \l {relates-command}{\\relates} command to associate the function
673
with a documented type, namespace, or a header file. The function is then
674
listed as a \e {related non-member} on the associated reference page.
675
676
\section1 No output generated for <entity> because <parent> is undocumented
677
678
QDoc issues this warning when parsing a documentation comment for an
679
API entity such as a class member, but cannot produce any output because
680
the associated parent (class) is not documented. Ensure that the parent is
681
documented and that QDoc is configured to parse the source file containing
682
the documentation comment.
683
684
If the documented member belongs to a class that is not meant to be
685
documented, mark the class as \qdoccmd {internal} or use the
686
\qdoccmd {dontdocument} command.
687
688
\section1 No such enum item <name> in <class>
689
690
Example:
691
692
\badcode
693
Cannot find 'QSGMaterialRhiShader::RenderState::DirtyState' specified
694
with \enum in any header file.
695
\endcode
696
697
QDoc issues this warning when it finds a \l{value-command}{\\value} directive in an
698
\l{enum-command}{\\enum} comment that names a value not found in the header file that declared
699
the enumerated type documented.
700
701
\section1 No such parameter
702
703
QDoc issues this warning when the parameter name given after an
704
\l{a-command}{\\a} command does not match any of the parameters named
705
in the header-file's declaration of the function or method being
706
documented.
707
708
\section1 No such <type> in QML <module>
709
710
QDoc issues this warning if a \l {qmlproperty-command} {\\qmlproperty},
711
\l {qmlmethod-command} {\\qmlmethod}, or \l {qmlsignal-command}
712
{\\qmlsignal} command argument uses a QML module identifier, but
713
the associated \l {qmltype-command}{\\qmltype} does not belong to
714
that module.
715
716
The QML module identifier, if defined, \b must match with the
717
\l {inqmlmodule-command} {\\inqmlmodule} argument in the QML type
718
documentation. In most cases, QDoc is able to locate the QML type
719
without a module identifier.
720
721
\section1 Overrides a previous doc
722
723
QDoc issues this warning when it finds two comments that appear to
724
describe the same entity. The location of the previously seen
725
comment is provided in warning details.
726
727
\section1 QML property documented multiple times: <identifier>
728
729
QDoc uses this warning when it finds two QDoc comments that document
730
the same QML property, either by appearing just before its definition,
731
or using the \l {qmlproperty-command}{\\qmlproperty} command.
732
733
\section1 QML type <TypeName> documented with <ClassName> as its native type. Replacing <ClassName> with <OtherClass>
734
735
If the \qdoccmd nativetype command is used with the same argument in
736
multiple QML type documentation comments that belong to the same
737
documentation project, QDoc issues this warning. To resolve this, ensure
738
that you use the \c {\nativetype} command only once for each C++ class.
739
740
\section1 QtDeclarative not installed; cannot parse QML
741
742
QDoc issues this warning if it has been compiled without support
743
for QML parsing. This should not happen unless you have a
744
custom build of QDoc.
745
746
\section1 Redundant link to self in \\sa command for <name>
747
748
A piece of documentation contains a link to itself in the references defined
749
in its \l {sa-command}{\\sa} command.
750
751
This problem tends to occur when there is a collection of related properties
752
or methods that refer to each other, and where the \\sa commands have been
753
copied between them, as in this example:
754
755
\badcode
756
\fn void Items::append(const Item &)
757
...
758
\sa append(), count(), insert(), remove()
759
\endcode
760
761
It is useful to replace the self-referencing link with one to another
762
related property or method.
763
764
Alternatively, the link may not be specific enough for QDoc to resolve, as
765
in this example:
766
767
\badcode
768
\fn void MyPicture::setSize(int)
769
...
770
\sa setSize()
771
\endcode
772
773
In this case, the intention may have been to refer to an overload that
774
accepts a \c double argument:
775
776
\badcode
777
\fn void MyPicture::setSize(int)
778
...
779
\sa setSize(double)
780
\endcode
781
782
\section1 The content is too long
783
784
QDoc uses a fixed-size buffer when tokenizing source files. If any single
785
token in the file has more characters than the maximum limit, QDoc issues
786
this warning.
787
788
While QDoc continues parsing the file, only the part of the token that
789
fits into the buffer is considered, meaning that the output might be
790
mangled.
791
792
To resolve this warning, the relevant content must be reduced in size,
793
either by splitting it, if possible, or by removing some of its parts.
794
795
The maximum amount of characters for a single token is shown alongside
796
the warning, for example:
797
798
\badcode
799
file.qdoc:71154: (qdoc) warning: The content is too long.
800
801
[The maximum amount of characters for this content is 524288.
802
Consider splitting it or reducing its size.]
803
\endcode
804
805
\note Since content that is too long is not parsed in full, QDoc may
806
issue warnings that are false positives. Resolve all warnings of this type
807
before fixing other warnings.
808
809
\section1 This page title exists in more than one file
810
811
The \l {title-command}{\\title} command sets the title for a page.
812
813
\code
814
\page activeqt-server.html
815
\title Building ActiveX servers in Qt
816
\endcode
817
818
QDoc issues this warning if a certain title is used in more than one page.
819
820
\section1 This qdoc comment contains no topic command (e.g., \\module, \\page)
821
822
If a QDoc comment doesn't contain a \l {Topic Commands}{topic command}, QDoc does
823
not know what the comment documents, and issues this warning.
824
Very similar to \l {Cannot tie this documentation to anything}, but
825
specific to comments that are not in C++ or QML files.
826
827
\section1 <topic> cannot be mixed with other topic commands
828
829
QDoc allows multiple topic commands in a single documentation
830
comment for certain \l{Writing Documentation#Multiple topics}{use cases}.
831
Using multiple topic commands from different categories prints
832
out this warning, and the topic generates no output.
833
834
\section1 Topic missing from generated Qt Help structure
835
836
QDoc generated a page for the topic, but none of the help projects
837
(\qdocvar{qhp}) defined in the configuration lists it in its
838
table of contents. Such a topic is missing from the generated \c{.qch}
839
file, so it cannot be browsed for in \QC or \QA.
840
841
The warning is followed by the name of the configuration file that was
842
expected to include the topic, for example:
843
844
\code [text]
845
qtwidgets.qdocconf does not define a qhp subproject that includes it.
846
\endcode
847
848
To resolve this warning, add a subproject that covers the topic, or widen
849
the \c selectors property of an existing one. For example, a subproject
850
with a \c{group:tutorials} selector picks up all pages that use the
851
\c {\ingroup tutorials} command. Alternatively, if the topic belongs
852
under a manual, add a link to it in the \\list of links on the page named
853
by the subproject's \c indexTitle property.
854
855
If the topic is intentionally left out of the help structure, tag it
856
with \c {\meta {toc} {nonessential}} to suppress the warning; see
857
\l {meta-command}{\\meta}.
858
859
QDoc does not issue this warning for pages that list the members a module
860
contributes to a type or a namespace documented in another module. Such
861
pages are reachable from, or link to, the full documentation of the type
862
or namespace.
863
864
See also \l {Creating Help Project Files}.
865
866
\section1 Type is its own base type: <type>
867
868
The QML type has been incorrectly defined as its own base type, possibly
869
using the \l {inherits-command}{\\inherits} command.
870
871
\section1 Unable to parse QML snippet: <code> at line <y>, column <x>
872
873
QDoc comments can contain QML code. This code can be found in a snippet,
874
or in the QDoc comments delimited by \l {qml-command}{\\qml} and {endqml-command}{\\endqml}.
875
876
Example:
877
878
If there is a syntax error in the QML code, QDoc issues the warning
879
\badcode
880
Unable to parse QML snippet: Syntax error at line 97, column 42
881
\endcode
882
883
Snippets can also contain QML and also there the code is checked. If there is
884
for example a missing curly brace in the code, QDoc issues the warning
885
\badcode
886
Unable to parse QML snippet: Expected token '{' at line 63, column 52
887
\endcode
888
889
QDoc often fails to parse incomplete QML snippets; in these cases,
890
it's often OK to replace the \\qml ... \\endqml commands with
891
\\code ... \\endcode to suppress this warning.
892
893
\section1 Unbalanced parentheses in <text>
894
895
Points to a '(' without a corresponding ')', or vice versa.
896
897
\section1 Undocumented enum item <enum> in <enum list>
898
899
<enum list>'s \l {value-command}{\\value} or \l {omitvalue-command}{\\omitvalue} entries
900
did not include one for \l {enum-command}{<enum>}, which is named in the
901
declaration of <enum list> in the header file.
902
903
\section1 Undocumented parameter
904
905
QDoc requires the documentation of a function or method to describe
906
every parameter. It recognizes this by each parameter name (as
907
specified where the function or method is declared in a header file)
908
appearing after a \l {a-command}{\\a} command.
909
910
This requirement is not imposed for function overload documentation,
911
provided that the overload is marked with the \qdoccmd overload command
912
and a fully-documented function with the same name exists.
913
914
\section1 Undocumented property '<name>'
915
916
This warning indicates that a C++ class has a Q_PROPERTY declaration that lacks
917
documentation. Properties are part of a class's public API and require
918
documentation using the \c \property command to describe their purpose,
919
valid values, and behavior.
920
921
\note If you see both "Cannot find '<ClassName::propertyName>' specified with
922
'\\property'" and "Undocumented property '<ClassName::propertyName>'" warnings
923
together, the \c \property command exists but cannot match the property in code.
924
Dual warnings indicate mismatched property documentation: the \c \property command
925
can't find its target, and the PropertyNode has no attached documentation. Check
926
that the fully qualified name matches exactly, including namespace and class scope.
927
928
\section1 Undocumented QML <module> referred by <type> or its members
929
930
QDoc issues this warning if it is unable to locate a QML module
931
based on the identifier passed to the
932
\l {inqmlmodule-command}{\\inqmlmodule} or \l {qmlproperty-command}
933
{\\qmlproperty} commands associated with a QML \e type.
934
935
This means that either documentation for the \l {qmlmodule-command}
936
{\\qmlmodule} is missing, or an incorrect module identifier was
937
used in \\qmlproperty, \\qmlmethod, or \\qmlsignal command(s).
938
939
\section1 Undocumented return value
940
941
For functions whose return-type is not void, QDoc checks if the return
942
value is documented. This warning is issued if the documentation for a
943
function or method doesn't contain a word starting with "return".
944
945
\section1 Unexpected <end_command>
946
947
This warning is issued if, for example, you have an \l {list-command}{\\endlist} without
948
a preceding \l {list-command}{\\list}. It applies to all commands that come in pairs (e.g.
949
startFoo/endFoo).
950
951
\section1 Unexpected \\snippet
952
953
QDoc issues this warning if it is unable to locate the snippet file
954
quoted in a \l {snippet-command}{\\snippet} command.
955
956
\section1 Unknown base <name> for QML type <type>
957
958
The type name declared as the base type for a QML type was not found, or
959
it was not declared with the \qdoccmd{inherits} command.
960
961
\section1 Unknown command <name>
962
963
When a QDoc comment uses a backslash followed by a token that is not a QDoc
964
built-in command and has not been defined as a custom command
965
\l {macro-variable}{macro}, QDoc produces this warning. Check the spelling
966
of the command name, and check whether your QDoc configuration doesn't
967
include whatever would have defined it, if it's a custom command.
968
969
This may also be produced due to code being quoted in the QDoc comment,
970
for example the author may have referred to the C string termination
971
character \c{'\0'} or one of the other C string escape sequences such
972
as \c{'\n'} without escaping the backslash. Escape the backslash
973
as \c{\} to include a literal backslash in the documentation, or
974
enclose the code fragment in \c{\c{...}}, which suppresses
975
interpretation of backslashes as introducing QDoc commands.
976
977
\section1 Unknown macro
978
979
QDoc issues this warning when it sees a backslash, \c{\}, followed
980
by a token it doesn't recognize as the name of either a built-in command
981
or a \l {macro-variable}{user-defined macro}. When quoting code
982
that contains character escape sequences, you should enclose the
983
code in \\c{...} to prevent this warning against the escape sequences.
984
985
\section1 Unrecognizable QML module/type qualifier for <identifier>
986
987
A parameter passed to \l {qmlproperty-command}{\\qmlproperty} or
988
\l {qmlmethod-command}{\\qmlmethod} contains a combination of
989
qmlModule::qmlType::identifier that is not defined anywhere.
990
991
Example:
992
\badcode
993
Unrecognizable QML module/type qualifier for real QtQuick::DragHandler::DragAxis::minimum
994
\endcode
995
996
DragHandler doesn't have a property called DragAxis.
997
998
\section1 Unrecognized list style <name>
999
1000
\\list can take an optional argument: a single number or character
1001
that modifies the list style. Refer to the {list-command}{\\list}
1002
documentation for more details. If you use an argument that is
1003
not recognized, QDoc issues this warning.
1004
1005
\section1 Unrecognized markup language
1006
1007
This warning occurs when a programming language is specified for a \\code
1008
command that QDoc does not recognize. For example, this QML code block has
1009
been given the invalid "QL" language:
1010
1011
\code [text] \\endcode
1012
\code [QL]
1013
Item {
1014
id: my_item
1015
}
1016
\1
1017
\endcode
1018
*/
qttools
src
qdoc
qdoc
doc
qdoc-warnings.qdoc
Generated on
for Qt by
1.18.0