I intend to create a customized Qt Assistant for providing help in my own application.
I followed the Qt documentation on that topic. The table of contents and all keywords are available when I launch the assistant, but my content is not shown.
Can anyone spot what I am doing wrong in this stripped down version?
test.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>
test.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>
I create the qhc file using qcollectiongenerator test.qhcp -o test.qhc
When I open the assistant using assistant -collectionFile test.qhc
, I only see a blank page, instead of index.html
's content.
This is caused by a bug in Qt Assistant: https://bugreports.qt-project.org/browse/QTBUG-24110
The html code needs to be at least 512 bytes long.