自定义Qt助手:内容未显示



我打算创建一个自定义的Qt助手,以便在我自己的应用程序中提供帮助
我遵循了Qt关于该主题的文档。当我启动助手时,目录和所有关键字都可用,但我的内容没有显示。

有人能发现我在这个精简版中做错了什么吗?

测试.qhp:

<?xml version="1.0" encoding="UTF-8"?>
<QtHelpProject version="1.0">
  <namespace>test</namespace>
  <virtualFolder>doc</virtualFolder>
  <filterSection>
    <toc>
      <section title="test" ref="index.html">
      </section>
    </toc>
    <keywords>
      <keyword name="Test" ref="index.html"/>
    </keywords>
    <files>
      <file>index.html</file>
    </files>
  </filterSection>
</QtHelpProject>

测试.qhcp:

<?xml version="1.0" encoding="UTF-8"?>
<QHelpCollectionProject version="1.0">
  <assistant>
    <title>test</title>
    <!--     <applicationIcon>images/handbook.png</applicationIcon> -->
    <cacheDirectory>test/doc</cacheDirectory>
    <startPage>qthelp://test/doc/index.html</startPage>
    <aboutMenuText>
      <text>About test</text>
    </aboutMenuText>
    <enableDocumentationManager>false</enableDocumentationManager>
    <enableAddressBar>false</enableAddressBar>
    <enableFilterFunctionality>false</enableFilterFunctionality>
  </assistant>
  <docFiles>
    <generate>
      <file>
        <input>test.qhp</input>
        <output>test.qch</output>
      </file>
    </generate>
    <register>
      <file>test.qch</file>
    </register>
  </docFiles>
</QHelpCollectionProject>

index.html:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
  <head>
    <title>Test title</title>
  </head>
  <body>
    <h1>index</h1>
    This is the index page
  </body>
</html>

我使用qcollectiongenerator test.qhcp -o test.qhc 创建qhc文件

当我使用assistant -collectionFile test.qhc打开助手时,我只看到一个空白页面,而不是index.html的内容。

这是由Qt Assistant中的一个错误引起的:https://bugreports.qt-project.org/browse/QTBUG-24110

html代码至少需要512字节长。

最新更新