• qt生成帮助文档过程


    qt生成帮助文档过程中必须依赖的的几种文件:
    .qdoc文件:txt格式,按qt documentation的规范编写的详细信息文档,.qdoc文件一般是总体介绍用的,关于类的documentation规范的详细信息一般都放在.cpp文件中。docmentation中有相关链接关联的语法。

    .qdocconf文件:txt格式,用于告诉qdoc.exe具体怎么去根据列出的路径下的.qdoc、.cpp等文件中的documentation标记, 生成.html、manifest.xml以及.hph等文件。

    .qhp文件:qt help project文件,xml格式,用于详细记录所有关键字,以及各个关键字之间的联系链接等等。

    .qch文档:qt compressed help文件,二进制格式,php文件的压缩形式。

    .qhcp文件:qt help collection project 文件,xml格式,用于关联多个qch文件。

    .qhc文件:qt help collection文件,二进制格式,qhcp文件的压缩形式。

    具体参考:目录->Qt Help->The Qt Help Framework
    具体文件:qthelp://org.qt-project.qthelp.5120/qthelp/qthelp-framework.html
     
    qt帮助文档生成过程(目录->QDoc Manual->Getting Started with QDoc):
    主要参考qt自身的Assistant工具的部分源码内容,这个工具的源码比较独立。位置在:“QtInstallDir\Qt5.12.0\5.12.0\Src\qttools\src\assistant”

    Qt Doc部分
    1、写出.qdocconf文件,指定要生成doc的路径、生成文件格式、生成路径以及定义属性和变量等等。(目录->QDoc Manual->Creating QDoc Configuration Files)
    下面是qtassitant.qdocconf文件:

    1. include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
    2. project = QtAssistant
    3. description = Qt Assistant Manual
    4. examplesinstallpath = assistant
    5. qhp.projects = QtAssistant
    6. qhp.QtAssistant.file = qtassistant.qhp
    7. qhp.QtAssistant.namespace = org.qt-project.qtassistant.$QT_VERSION_TAG
    8. qhp.QtAssistant.virtualFolder = qtassistant
    9. qhp.QtAssistant.indexTitle = Qt Assistant Manual
    10. qhp.QtAssistant.filterAttributes = qt $QT_VERSION tools assistant
    11. qhp.QtAssistant.customFilters.QtAssistant.name = Qt Assistant Manual
    12. qhp.QtAssistant.customFilters.QtAssistant.filterAttributes = qt tools assistant
    13. qhp.QtAssistant.subprojects = manual examples
    14. qhp.QtAssistant.subprojects.manual.title = Manual
    15. qhp.QtAssistant.subprojects.manual.indexTitle = Qt Assistant Manual
    16. qhp.QtAssistant.subprojects.manual.selectors = fake:page
    17. qhp.QtAssistant.subprojects.examples.title = Examples
    18. qhp.QtAssistant.subprojects.examples.indexTitle = Qt Assistant Examples
    19. qhp.QtAssistant.subprojects.examples.selectors = fake:example
    20. qhp.QtAssistant.subprojects.examples.sortPages = true
    21. language = Cpp
    22. sourcedirs = ..
    23. exampledirs = ../../../../examples/assistant \
    24. snippets
    25. imagedirs = images
    26. depends += qtdoc qmake
    27. # Use a generic thumbnail image for examples that have no images in their docs
    28. manifestmeta.thumbnail.names += "QtAssistant/Remote Control Example"
    29. navigation.landingpage = "Qt Assistant Manual"

     include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)所包含的文件在QtInstallDIr\Qt5.12.0\5.12.0\msvc2015_64\doc\global中或在src/qtbase/global中可以找到。该语句表示执行qtassistant.qdocconf之前会先执行qt-module-defaults.qdocconf。


    2、按QDoc的documentation规范在C++文件、qml文件或 .qdoc文件中写出自己的Document标记(目录->QDoc Manual->Writing Documentation)

    下面是QtInstallDir\Qt5.12.0\5.12.0\Src\qttools\src\assistant\assistant\doc\src\assistant-manual.qdoc 中的部分内容: 

    1. /*!
    2. \page qtassistant-index.html
    3. \title Qt Assistant Manual
    4. \ingroup qttools
    5. \startpage {Qt Reference Pages}
    6. \nextpage Qt Assistant Quick Guide
    7. \keyword Qt Assistant
    8. \QA is a tool for viewing on-line documentation in Qt help file format.
    9. For more information about basic \QA functions, see
    10. \l{Qt Assistant Quick Guide}.
    11. Qt installations include a set of reference and tools documentation that
    12. you can view in the Qt Creator IDE and in \QA. You can add custom
    13. documentation to the set of documents displayed in the \QA main view. For
    14. detailed information about all \QA functions, see \l{Using Qt Assistant}.
    15. You can use \QA as the help viewer in your applications. You can display
    16. your own documentation and customize \QA to look and feel like part of your
    17. application. You can change the window title or icon, as well as menu texts
    18. and actions. For more information, see \l{Customizing Qt Assistant}.
    19. \section1 Table of Contents
    20. \list
    21. \li \l{Qt Assistant Quick Guide}
    22. \li \l{Using Qt Assistant}
    23. \li \l{Customizing Qt Assistant}
    24. \endlist
    25. */

    3、运行

    qdoc qtassistant.qdocconf

    qdoc会按qtassitant.docconf所设置的要求生成html和qhp文件。


    Qt Assistant 部分:

    4、利用qthelpgenerator和前面生成的php文件生成qch文件

     qhelpgenerator qtassistant.qhp -o qtassistant.qch

    5、编辑qtassistant.qhcp文件。再用qthelpgenerator生成qhc文件。

    qhelpgenerator qtassistant.qhcp -o qtassistant.qhc

    6、运行

    assistant -collectionFile qtassistant.qhc

    也可以通过Assistant的配置界面添加:

    详细解释具体参考:目录->Qt Assistant Manual->Qt Assistant Examples->Simple Text Viewer Example

    qt assitant 依赖qch文件,每一个模块都拥有自己的qch文件,存放在QInatallDir\Qt5.12.0\Docs\Qt-5.12.0\中。用户可以生成自己内容相关的帮助手册,可以通过qt5.12.0帮助手册中的qdoc manual 并结合qt src中相关内容生成qt帮助手册的过程进行学习。qhp、qch、qhc、qhcp之间的关系及这些文件的作用可以参考 

    目录->Qt Help ->The Qt Help Framework。
    具体文件位置:qthelp://org.qt-project.qthelp.5120/qthelp/qthelp-framework.html

    目录->Qt Assistant Manual->Qt Assistant Examples->Simple Text Viewer Example
    ->Creating Documentation and Customizing Qt Assistant 项。
    具体文件位置:qthelp://org.qt-project.qtassistant.5120/qtassistant/qtassistant-simpletextviewer-example.html

    assitant可以指定自定义的qch文件,这样就只会展示指定的qch文件内容。未指定正确的qch文件,qt会生成默认的qch文件,其包含了qt原始的所有模块内容。
     


    Qt Creator Manual->Using the Help Mode

    Adding External Documentation

    You can display external documentation in the Help mode. To augment or replace the documentation that ships with Qt Creator and Qt:

    For information on how to prepare your documentation and create a .qch file, see The Qt Help Framework.

    1. Create a .qch file from your documentation.
    2. To add the .qch file to Qt Creator, select Tools > Options > Help > Documentation > Add.

    qt Example Manifest Files_丘上人的博客-CSDN博客 
    qt 文档_丘上人的博客-CSDN博客 

  • 相关阅读:
    攻防世界---misc---心仪的公司
    [C++学习] 多进程通信共享内存
    运行java命令出现 Error: Invalid or corrupt jarfile XXX.jar
    SSM整合
    《动手学深度学习 Pytorch版》 9.2 长短期记忆网络(LSTM)
    vue-router4之组合式API
    编写hello驱动程序
    基于51单片机16×16点阵广告牌的滚动显示仿真设计
    判断文本元素是否出现省略号,根据文本长度来控制是否显示鼠标悬浮提示el-tooltip
    初识jetson tx2
  • 原文地址:https://blog.csdn.net/qiushangren/article/details/126761134