生成 qch 帮助文档

生成 qch 帮助文档

安装 doxygen

sudo apt install doxygen
sudo apt install doxygen-gui

在工程新建doc目录

使用doxygen 或者 doxywizard 生成 html文档

doxywizard 是gui界面

在doc 目录中创建 myhelp.qhp
<?xml version="1.0" encoding="UTF-8"?>
<QtHelpProject version="1.0">
  <namespace>myhelp</namespace>
  <virtualFolder>doc</virtualFolder>
  <filterSection>
    <toc>
        <section title="首页" ref="html/index.html">
            <section title="函数" ref="html/functions.html"></section>
            <section title="继承关系" ref="html/hierarchy.html"></section>
            <section title="mainwindow.h" ref="html/mainwindow_8h_source.html"></section>
        </section>
    </toc>
    <keywords>
        <keyword name = "MyQtHelp" ref="html/index.html"></keyword>
    </keywords>
    <files>
      <file>html/*.md5</file>
      <file>html/*.map</file>
      <file>html/*.html</file>
      <file>html/*.js</file>
      <file>html/*.css</file>
      <file>html/*.png</file>
      <file>html/*.ico</file>
      <file>imges/*.ico</file>
      <file>html/search/*.html</file>
      <file>html/search/*.js</file>
      <file>html/search/*.css</file>
      <file>html/search/*.png</file>
    </files>
  </filterSection>
</QtHelpProject>

生成 qch文档

qhelpgenerator myhelp.qhp -o myhelp.qch

注册到 assistant, 查看

assistant -register myhelp.qch

#取消注册
# assistant -unregister myhelp.qch

#查看
assistant

生成 assistant 的 collectionFile (*.qhc)

新建 myhelp.qhcp
<?xml version="1.0" encoding="utf-8" ?>
<QHelpCollectionProject version="1.0">
    <docFiles>
        <register>
            <file>myhelp.qch</file>
        </register>
    </docFiles>
</QHelpCollectionProject>

命令:

qhelpgenerator myhelp.qhcp -o myhelp.qhc

再次修改 myhelp.qhcp:

<?xml version="1.0" encoding="utf-8" ?>
<QHelpCollectionProject version="1.0">
    <docFiles>
        <generate>
            <file>
                <input>myhelp.qhp</input>
                <output>myhelp.qch</output>
            </file>
        </generate>
        <register>
            <file>myhelp.qch</file>
        </register>
    </docFiles>
</QHelpCollectionProject>

assitant 参数启动 (*.qhc)

 assistant -collectionFile myhelp.qhc

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值