マニフェスト・ファイルの例

QDocは、ドキュメント化されたすべての例に関する情報を含むexample-manifest.xmlファイルを生成します。これらのファイルは、Qt Creator 、ウェルカム画面に例のリストを表示し、そのドキュメントにリンクするために使用されます。

マニフェスト XML 構造

マニフェスト ファイルの構造は次のとおりです:

<?xml version="1.0" encoding="UTF-8"?>
<instructionals module="QtGui">
    <examples>
        <example
            name="Analog Clock Window"
            docUrl="qthelp://org.qt-project.qtgui.502/qtgui/analogclock.html"
            projectPath="gui/analogclock/analogclock.pro"
            imageUrl="qthelp://org.qt-project.qtgui.502/qtgui/images/analogclock-window.png">
            <description><![CDATA[The Analog Clock Window example shows how
                to draw the contents of a custom window.]]></description>
            <tags>analog,clock,window</tags>
            <fileToOpen>gui/analogclock/main.cpp</fileToOpen>
        </example>
        ...
    </examples>
</instructionals>

<example> 要素には、名前、説明、プロジェクト ファイルの場所、ドキュメント、およびサンプルに関連するタグのリストに関する情報が含まれます。

マニフェストのメタコンテンツ

manifestmeta コンフィギュレーション コマンドを使用して、マニフェスト ファイルに追加のメタ コンテンツ、つまり選択されたサンプルの追加属性やタグを追加することができます。

メタコンテンツの 1 つの使用例は、多数の顕著な例を強調することです。もうひとつは、あるカテゴリの例に関連するキーワードをタグとして追加することにより、検索機能を向上させることです。

メタコンテンツが適用される例は、1つ以上のフィルターを使って指定されます。例とフィルタのマッチングは、モジュール名とスラッシュを前置した各例の名前に基づいて行われます。単純なワイルドカードによるマッチングがサポートされています。* を最後に使うことで、1つの文字列で複数の例にマッチさせることができます。

manifestmeta.filters                = highlighted sql webkit global

manifestmeta.highlighted.names      = "QtGui/Analog Clock Window" \
                                      "QtWidgets/Analog Clock"
manifestmeta.highlighted.attributes = isHighlighted:true

manifestmeta.sql.names              = "QtSql/*"
manifestmeta.sql.tags               = database,sql

manifestmeta.webkit.names           = "QtWebKitExamples/*"
manifestmeta.webkit.tags            = webkit

manifestmeta.global.names           = *
manifestmeta.global.tags            = qt6

上で、isHighlighted 属性が2つの例に追加されています。属性値が省略された場合、QDocはデフォルトで文字列true 。Qt WebKitとQt SQL の例には追加のタグが追加され、* をマッチ文字列として使用することで、すべての例に別のタグが適用されます。

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.