Nominate our 2022 Qt Champions!

Cannot open .qhc files in QWebView

  • Hi everyone.

    I have to implement an embedded help in an application, using .qhc and .qch files generated from Doxygen.

    I successfully managed to open the .qch via Qt Assistant, meaning this file is correctly built.

    Now I would like to display the documentation, using QHelpEngine.

    // QHelpEngine
    m_helpEngine = new QHelpEngine("absolute_path_to_doc_folder/doc.qhc");
    if (m_helpEngine->setupData() == false)
       qDebug() << m_helpEngine->error();

    I implemented the index and content widgets, using signals and slots to handle links opening. But when I click on an index or on a content, the page is always blank. The only way I found to display the documentation correctly is to have a directory that contains the HTML/CSS/picture files generated by Doxygen. With a simple trick, I replace 'qch' with 'html' in url when loaded and then I can see the documentation.

    Yet, Qt Assistant doesn't need this to display correctly the documentation, and on top of that, from only a .qch file.

    I looked at the source code of Qt Creator in order to find what they did that I don't, but I found nothing relevant there.

    Does anyone know how to create a help widget that displays documentation from only a .qch and a .qhc files?

    There is really few documentation about embedding help in an application, so any hint would be greatly appreciated. Thanks in advance.

  • I updated my previous post since I solved part of the issue.