Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-9049

QHelpEngineCore::fileData always returning emtpy QByteArray

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P4: Low
    • 4.7.0
    • 4.6.1, 4.6.2
    • Tools: Assistant
    • 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.

      Attachments

        1. HelpTest.zip
          2 kB
          Robert Escott
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            heimrich Karsten Heimrich
            robbiee Robert Escott
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes