[PyQt] PyQt.QtHelp - QFSFileEngine::open: No file name specified

romain rbe at arxsys.fr
Tue Nov 23 13:28:16 GMT 2010

Hi everybody,

I am facing an issue when I use the PyQt.QtHelp module. I have generated
a .qhc file containing the documentation I want to embed into my soft so
users can access it directly. It is made up with .html pages.

I have joined the code in attachment. I simplified it so it can be used
in a "stand-alone" software, but it is in fact part of a bigger program.
My problem is the same in both cases anyway.

(This code is more or less the same as in the QtHelp example from Qt :
http://doc.trolltech.com/qq/qq28-qthelp.html and
http://doc.trolltech.com/qq/qq28-qthelp.zip for the example code).

When I launch my soft, and click on one of the link of the table of
content, the error message "QFSFileEngine::open: No file name specified"
is displayed, and consequently the documentation is not displayed. The
HelpBrowser.loadResources() method is called by HelpBrowser.setSource()
when a link of the table of content is double-clicked.

I have made some tests : when I connect the "linkActivated" signal to a
method calling QHelpEngine.fileData(url), and then set the returned html
into the HelpBrowser (using setHtml() method), it displays the requested
resource, but CSS and images are not loaded. The QVariant returned by
the QHelpEngine.fileData(url) method contents correct html.

The "C++ version" of this code works perfectly and I can visualize the
documentation within the software.

Do you have any idea why when the setSource() slot is called this error
occurs ? Is my code incorrect ? I could overload the setSource method
and "manually" call loadResources() for each resources contained in the
displayed html page (such as .css files and images), but if there is an
other way it would be fine.

The installed version of PyQt is the 4.6-1 and I am running an Ubuntu
9.10 karmic koala. My version of Python is 2.6.4. The error I encounter
also appears on Gentoo.

I hope these explanations are not too vague. Thanks you in advance for
any help you could provide :)


rbe at arxsys.fr
http://www.arxsys.fr - http://www.digital-forensic.org/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: help.py
Type: text/x-python
Size: 2152 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20101123/497fddb1/attachment.py>

More information about the PyQt mailing list