Qt qrc文件中的注释

lig*_*tep 6 resources qt

如何在Qt qrc文件中添加评论?我试过//和/**/,但这给了我一个错误"RCC Parse error ... [unexpected text]".样本文件:

<RCC>
<qresource>
    // images
    <file>image1.png</file>
    <file>image2.png</file>

    // qml documents
    <file>doc1.qml</file>
    <file>doc2.qml</file>
</qresource>
</RCC>
Run Code Online (Sandbox Code Playgroud)

小智 10

.qrc文件的格式基于XML.因此,您可以使用XML样式进行注释:

    Comment    ::=      '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
Run Code Online (Sandbox Code Playgroud)

评论的一个例子:

<!-- declarations for <head> & <body> -->
Run Code Online (Sandbox Code Playgroud)

XML规范


Sam*_*ack 5

您可以使用<!-- --> 例如

<!-- this is my comment in qrc file -->
Run Code Online (Sandbox Code Playgroud)