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