一键导入
skill-line-wrap
Reference for Qt's 80-column rule and text wrapping guidelines for documentation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Reference for Qt's 80-column rule and text wrapping guidelines for documentation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Qt documentation products, modules, repository structure, and API types. Apply when working with Qt documentation, resolving module names, or understanding Qt's documentation ecosystem.
Authoritative style rules for writing accessibility alt text in Qt documentation, including priority order, formatting rules, and terminology guidelines. Use when adding alt text to images.
Cross-product impact checking for Qt documentation changes. Load this skill whenever a doc change (page rename, title change, filename change, API rename, QML type rename) may affect products outside the changed module. Covers all doc.qt.io products, all doc-snapshots.qt.io products, and qt.io marketing pages. Provides verified snapshot paths, index file availability, link mechanisms per product, and search procedures in priority order. Use alongside doc-impact-analyzer Steps 5–6 or standalone when auditing cross-product reference breakage.
Structured findings report format shared by doc-structure-auditor and doc-impact-analyzer. Covers severity levels, finding types, summary tables, validation blocks, notes, and verdicts.
Reference for the Qt Doc Team diff format - generic feedback and recommendation template with validation and approval workflow
Language, grammar, and style guidelines for Qt documentation including active voice, terminology, QUIP 25 standards, and proper API documentation patterns. Covers both WHAT to write (style/content) and HOW to write it (QDoc syntax).
| name | skill-line-wrap |
| description | Reference for Qt's 80-column rule and text wrapping guidelines for documentation |
| metadata | {"version":"1.2"} |
This reference documents Qt's 80-column rule and provides guidelines for wrapping documentation text to comply with Qt code style.
Documentation agents use this reference to:
Qt source files follow an 80-column guideline, but enforcement varies by context.
The rule is required for code and structured content, but advisory for prose paragraphs.
| Context | Enforcement | Threshold | Action |
|---|---|---|---|
| C++ code | Required | 80 | Flag as issue |
Code examples (\code) | Required | 80 | Flag as issue |
| Alt text | Required | 80 | Flag as issue |
| QDoc commands | Required | 80 | Flag as issue |
| Prose paragraphs | Advisory | 110 | Flag only if ≥110 |
| Brief descriptions | Advisory | 110 | Flag only if ≥110 |
| Table cells | Advisory | 110 | Flag only if ≥110 |
| Unbreakable content | Exempt | — | Never flag |
For advisory contexts (prose paragraphs, brief descriptions, table cells):
End-of-review note: If a patch contains advisory lines between 81-109 characters, add a non-blocking note at the end of the review:
Note: This patch contains prose lines exceeding 80 columns. Consider wrapping for consistency with Qt style.
Count from column 0 (start of line):
Column: 0 1 2 3 4 5 6 7 8
0123456789012345678901234567890123456789012345678901234567890123456789012345678901
This line is exactly 80 characters including spaces and indentation
Includes:
Maximum: 80 characters (positions 0-79)
Qt uses 4-space indentation consistently:
/*!
\class ClassName
\inmodule ModuleName
\internal
*/
Each level: 4 spaces
/*!
Line at indentation level 0 (4 spaces from left margin)
\command at level 0
Continued text at level 0
Text can continue for multiple lines at same level
*/
Rule: All content inside /*! ... */ is indented 4 spaces.
Wrap text when:
Example:
Column count: 81 characters
This is a very long line of documentation text that exceeds the eighty character limit
Must wrap to:
This is a very long line of documentation text that exceeds
the eighty character limit
Priority order:
param1, param2, param3 → break after commaExample:
Before (85 chars):
The function takes three parameters: name, age, and address for the user record.
After:
The function takes three parameters: name, age, and address
for the user record.
Avoid breaking:
QQuickItem (keep together)Q_OBJECT, Q_QUICK_EXPORTKeep QDoc commands on their own line:
✅ Correct:
/*!
\class ClassName
\inmodule ModuleName
\internal
*/
❌ Wrong:
/*!
\class ClassName \inmodule ModuleName \internal
*/
If \class command exceeds 80 columns:
/*!
\class VeryLongNamespace::VeryLongClassName::NestedClass
\inmodule QtVeryLongModuleName
\internal
*/
Count:
\class )If total > 80, nothing you can do - keep class name intact.
Wrap at natural boundaries:
/*!
\class QQmlSA::PropertyPrivate
\inmodule QtQmlCompiler
\internal
This is an internal class used for managing property
metadata in the QML static analyzer. It stores information
about property types, bindings, and validation rules.
*/
Indentation: Continuation lines maintain same 4-space indent.
Alt text appears in {} braces after image filename:
\image filename.png
{Alt text description that might be long enough to
require wrapping across multiple lines}
Rules:
{ on first line} on last lineColumn counting:
Column: 0 1 2 3 4 5 6 7 8
012345678901234567890123456789012345678901234567890123456789012345678901234567890
\image filename.png
{Window with toolbar containing dark mode toggle and
multiple action buttons for file operations}
Line 1: 4 (indent) + 6 (\image) + 1 (space) + 12 (filename.png) = 23 ✓
Line 2: 7 (brace indent) + 57 (text) = 64 ✓
Line 3: 7 (brace indent) + 48 (text including }) = 55 ✓
/*!
This class provides:
\list
\li Feature one with a long description that needs
to wrap to the next line
\li Feature two
\li Feature three with another long description
that also wraps
\endlist
*/
Indentation:
\list, \endlist: 4 spaces\li: 4 spaces/*!
Example usage:
\code
ReallyLongClassName object;
object.veryLongMethodName(parameter1, parameter2,
parameter3);
\endcode
*/
For code blocks:
()If a single word/element exceeds 80 columns:
URLs: Keep intact
// Acceptable: URLs can exceed 80 columns
See https://doc.qt.io/qt-6/very-long-page-name-that-exceeds-eighty-characters.html
File paths: Keep intact
// Acceptable: Paths can exceed 80 columns
File location: qtdeclarative/src/qmlcompiler/qqmlsomemodule/qqmlsomeverylong filename.cpp
Class names: Never break
\class QVeryLongNamespaceName::QVeryLongClassName
Function signatures: Try to break at parameters
void ClassName::veryLongFunctionName(
int parameter1, int parameter2)
/*!
\table
\header
\li Property
\li Description
\row
\li propertyName
\li Long description that wraps to next line
with proper indentation
\endtable
*/
Indentation:
\table, \endtable: 4 spaces\header, \row: 4 spaces\li: 8 spaces/*!
\section1 Very Long Section Title That Might Exceed
Eighty Characters
Content follows...
*/
Break section titles at natural boundaries, align continuation.
1. Identify line length (count from column 0)
2. If length ≤ 80: Done
3. If length > 80:
a. Find last break point before position 80
b. Break at that point
c. Apply proper continuation indent
d. Repeat for next line
1. Scan from position 80 backwards
2. Look for (in order):
- Space after comma
- Space after preposition
- Space after conjunction
- Any space at natural phrase boundary
3. Use first found break point
4. If no break point before position 40:
- Line is mostly unbreakable
- Keep as-is or break at position 80
Depends on context:
| Context | Indent Rule | Example |
|---|---|---|
| QDoc comment | Same as first line (4 spaces) | Text continues |
| Alt text | Align under text (7 spaces) | {Text continues |
| Function params | Align under opening ( | parameter) |
| List items | Double indent (8 spaces) | continuation |
| Table cells | Triple indent (12 spaces) | continuation |
| QDoc command + text | Hanging indent (align with text) | See below |
Valid pattern: Continuation lines align with the start of text after a QDoc command, not with the command itself.
\note Support for specific configurations or operating system versions may
end before the support for Qt \qtver does.
^^^^ ^^^^^^
4sp +6 chars (\note ) = 10 spaces aligns with "Support..."
This is correct. The continuation aligns with the prose, not the \note command.
Applies to:
\note + text (6 chars → 10-space continuation)\warning + text (9 chars → 13-space continuation)\section1 + title (10 chars → 14-space continuation)Do NOT flag as inconsistent indentation. This is intentional alignment for readability.
Contrast with block-level continuation:
\note
This is a note that starts on its own line.
Continuation stays at 4-space indent.
When the command and text are on separate lines, use standard 4-space indent.
Before (83 characters):
This is a documentation line that is too long and exceeds the eighty character rule.
After (break after "exceeds"):
This is a documentation line that is too long and exceeds
the eighty character rule.
Before (88 characters on line 2):
\image controls-gallery.png
{Gallery window displaying all Qt Quick Controls in the Basic style with examples}
After (break at natural boundary):
\image controls-gallery.png
{Gallery window displaying all Qt Quick Controls in the
Basic style with examples}
Before submitting documentation:
Required (must fix):
Advisory (flag if ≥110, note if 81-109):
Exempt (never flag):
Bash command:
# Check line lengths in a file
cat file.cpp | awk '{print length, $0}' | grep "^[8-9][0-9]" | head -20
Key Points:
Quick Reference:
End-of-Review Note (for advisory content 81-109 chars):
Note: This patch contains prose lines exceeding 80 columns. Consider wrapping for consistency with Qt style.