Share Files between different Qt Help Project Files
-
Hi
I would like to share Javascript source files between different Qt Help Project files. Example:
I have two qhp files
helpA.qhp
<?xml version="1.0" encoding="UTF-8"?> <QtHelpProject version="1.0"> <namespace>namespaceA</namespace> <virtualFolder>doc</virtualFolder> <filterSection> <toc> <section title="Title Help A" ref="indexA.html"> </section> </toc> <files> <file>script.js</file> </files> </filterSection> </QtHelpProject>
helpB.qhp
<?xml version="1.0" encoding="UTF-8"?> <QtHelpProject version="1.0"> <namespace>namespaceB</namespace> <virtualFolder>doc</virtualFolder> <filterSection> <toc> <section title="Title Help B" ref="indexB.html"> </section> </toc> </filterSection> </QtHelpProject>
For both files indexA.html and indexB.html I am referencing the javascript using:
<script src="script.js"></script>
When I compress helpA.qch then the javascript is properly loaded. However in helpB.qch the javascript is not found. I was thinking this should be fine, since both help project files specify the same virtual folder.
How can I share files between different .qch files?
Thanks and best regards
-
The URLs passed to QTextEdit::loadResource() in my project are qthelp://<namespace>/<virtualFolder>/<relative path...>. Based on this, I presume that sharing between namespaces can be accomplished referencing an absolute path including the namespace and virtual folder, or a relative path that ascends the parent hierarchy as appropriate.
An alternative is to check for
script.js
in every request.Edit: QUrl::host() reports the namespace. A relative path using ../ doesn't appear to be an option.