qt自定义帮助文档 文件模板

1.编写号html格式的帮助文档

2.创建helpDoc.qhp文件

<?xml version="1.0" encoding="GB2312"?>
<QtHelpProject version="1.0">
	<namespace>HMIHelpDoc</namespace>
	<virtualFolder>doc</virtualFolder>
	<filterSection>
		<toc>
			<section title="一级节点1" ref="11111.html"/>
			<section title="一级节点2" ref="22222.html"/>
			<section title="一级节点3" ref="33333.html">
				<section title="二级节点1" ref="66666.html"/>
				<section title="二级节点2" ref="444444.html"/>
			</section>
		</toc>
		<keywords>
			<keyword name="key1" id="key1" ref="1111.html"/>
			<keyword name="key2" id="key2" ref="2222.html"/>
		</keywords>
		<files>
			<file>11111.html</file>
			<file>22222.html</file>
			<file>333333.html</file>
			<file>images/*.png</file>
			<file>style/*.css</file>
		</files>
	</filterSection>
</QtHelpProject>

3.编写helpDoc.qhcp文件,名字随意

<?xml version="1.0" encoding="GB2312"?>
<QHelpCollectionProject version="1.0">
<assistant>
  <title>我的帮助文档</title>
  <applicationIcon>images/doc.png</applicationIcon>
  <cacheDirectory></cacheDirectory> 
  <homePage>qthelp://qhp中的namespace节点/qhp中的virtualFolder节点/index.html</homePage>
  <startPage>qthelp://qhp中的namespace节点/qhp中的virtualFolder节点/index.html</startPage>
  <aboutMenuText>
    <text>aboust</text>
  </aboutMenuText>
  <aboutDialog>
    <file>about.txt</file>
    <icon></icon>
  </aboutDialog>
  <enableDocumentationManager>false</enableDocumentationManager>
  <enableAddressBar>false</enableAddressBar>
  <enableFilterFunctionality>false</enableFilterFunctionality>
</assistant>
<docFiles>
  <generate>
    <file>
      <input>helpDoc.qhp</input>
      <output>helpDoc.qch</output>
    </file>
  </generate>
  <register>
    <file>helpDoc.qch</file>
  </register>
</docFiles>
</QHelpCollectionProject>

3.生成,新建一个docs文件夹将html文件,上面创建的文件放里边,创建一个bat文件与docs同级,bat内容如下:

cd /d %~dp0

echo register my help ...

del ./docs/helpDoc.qch
del ./docs/helpDoc.qhc

qhelpgenerator  ./docs/helpDoc.qhp  -o ./docs/helpDoc.qch
assistant -register ./docs/helpDoc.qch
qcollectiongenerator    ./docs/helpDoc.qhcp  -o ./docs/helpDoc.qhc
assistant -collectionfile ./docs/helpDoc.qhc

echo -------------over----------------

pause

需要将qhelpgenerator,qcollectiongenerator.exe 路径添加到path 或者 拷贝到bat所在目录,拷贝更方便。

4.可以创建个assistant.exe的快捷方式,添加命令行参数 -collectionfile ./docs/helpDoc.qhc 方便查看

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值