Details
-
Bug
-
Resolution: Invalid
-
P4: Low
-
4.6.1, 4.6.2
-
None
-
WIndows XP
Description
In the documentation explaining the Qt Help Framework, an example is given for retrieving data from the QtHelp system.
Firstly, QHelpEngineCore::linksForIdentifier(QString) is called to retrive all QString/QUrl pairs found. Secondly, the data for each QUrl can be retrieved into a QByteArray using QHelpEngineCore::fileData(QUrl).
Unfortunately, the QByteArray always returns empty. When tracing the code, it was found that each QUrl found in the help file is constructed by QHelpDBReader::buildQUrl. The QUrl is contructed in the form: qthelp:virtualFolder/relFileName#anchor
When trying to retrieve the data using the QUrl, QHelpEngineCore::fileData does some checks. The third of these checks counts the number of '/' characters in the QUrl::toString() and if there are less than 4 '/' characters, an empty QByteArray is returned. Since QHelpDBReader::buildQUrl only inserts a single '/' character, this function never gets past the checks.
Upon skipping the checks, the correct help data for the ID is returned.