Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QHelpEngine

QHelpEngine

Scheduled Pinned Locked Moved Unsolved General and Desktop
qhelpengineqdocqhcdoxygen
6 Posts 3 Posters 2.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Gojir4G Offline
    Gojir4G Offline
    Gojir4
    wrote on last edited by Gojir4
    #1

    Hi, I'm actually trying to provide documentation inside one of my Qt application and I'm not able to make it working.

    I have generate qhc and qch files using doxygen, and I'm able to load this file into Qt Assistant and browse all elements contained in the qhc file.

    But now I'm trying to display this into a Qt Application using QHelpEngine, without success.
    QHelpEngine is able to load the qhc file, but QHelpEngine::indexModel() and QHelpEngine::contentModel() are empty.

    Here is my code used to test it:

    Widget::Widget(QWidget *parent)
        : QWidget(parent)
    {
    
        //*
       QFileInfo fileInfo("help.qhc");
       if (fileInfo.exists()) {
           QHelpEngine* he = new QHelpEngine(fileInfo.absoluteFilePath());
           qDebug() << "Setup data: " << he->setupData();
           qDebug() << he->error();
           qDebug() << fileInfo.absoluteFilePath();
    
           QHelpContentWidget *contentWidget = he->contentWidget();
           QHelpIndexWidget* indexWidget = he->indexWidget();
    
           he->searchEngine()->queryWidget()->show();
           he->searchEngine()->resultWidget()->show();
    
           QSplitter* splitter = new QSplitter();
           splitter->addWidget(contentWidget);
           splitter->addWidget(indexWidget);
    
           QHelpContentModel *contentModel = he->contentModel();
           QHelpIndexModel* indexModel = he->indexModel();
           contentWidget->setModel(contentModel);
           indexWidget->setModel(indexModel);
    
           qDebug() << "Content model count: " << contentModel->rowCount();
           qDebug() << "Index model count: " << indexModel->rowCount();
    
           QHBoxLayout *hl = new QHBoxLayout;
           hl->addWidget(splitter);
           setLayout(hl);
       }
      //...
    }
    

    and the output:

    Setup data:  true
    ""
    "path_to_my_file/help.qhc"
    Content model count:  0
    Index model count:  0
    

    I cannot see what I'm missing here. Any help would be appreciated.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Which version of Qt are you using ?
      On which platform ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      Gojir4G 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        Which version of Qt are you using ?
        On which platform ?

        Gojir4G Offline
        Gojir4G Offline
        Gojir4
        wrote on last edited by
        #3

        @SGaist Hi,
        Qt 5.10.1
        Windows 10

        JonBJ 1 Reply Last reply
        0
        • Gojir4G Gojir4

          @SGaist Hi,
          Qt 5.10.1
          Windows 10

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @Gojir4
          I know nothing about this, but...

          Your code seems to be from old post https://forum.qt.io/topic/3880/qhelpengine-how-to , or maybe you got it from same source? Anyway, have you read through all the posts there seemingly describing your situation? Some claim to have got it working. Though I admit the final, unanswered post (https://forum.qt.io/topic/3880/qhelpengine-how-to/22) looks a lot like you..?

          Or, does the code at https://github.com/srish/QtHelpManual/blob/master/main.cpp (a) work and (b) help you?

          Gojir4G 2 Replies Last reply
          3
          • JonBJ JonB

            @Gojir4
            I know nothing about this, but...

            Your code seems to be from old post https://forum.qt.io/topic/3880/qhelpengine-how-to , or maybe you got it from same source? Anyway, have you read through all the posts there seemingly describing your situation? Some claim to have got it working. Though I admit the final, unanswered post (https://forum.qt.io/topic/3880/qhelpengine-how-to/22) looks a lot like you..?

            Or, does the code at https://github.com/srish/QtHelpManual/blob/master/main.cpp (a) work and (b) help you?

            Gojir4G Offline
            Gojir4G Offline
            Gojir4
            wrote on last edited by
            #5

            Hi @JonB ,

            You are right, this is highly inspired from the old post about the same subject. But as I didn't find any solution I made a a new one .

            Maybe I need to add the HelpBrowser class and make this connection as suggessted by your second link.

              QObject::connect(helpEngine->contentWidget(), SIGNAL(linkActivated(const QUrl &)),
            helpBrowser, SLOT(setSource(const QUrl &)));
            

            But I have also checked my qhc file using the sample projet Context-Sensitive Help Example and it doens't seems to work too. So I guess ther is another issue.
            I will check that tomorrow as I'm out of office now.
            Thanks for your valuable input.

            1 Reply Last reply
            0
            • JonBJ JonB

              @Gojir4
              I know nothing about this, but...

              Your code seems to be from old post https://forum.qt.io/topic/3880/qhelpengine-how-to , or maybe you got it from same source? Anyway, have you read through all the posts there seemingly describing your situation? Some claim to have got it working. Though I admit the final, unanswered post (https://forum.qt.io/topic/3880/qhelpengine-how-to/22) looks a lot like you..?

              Or, does the code at https://github.com/srish/QtHelpManual/blob/master/main.cpp (a) work and (b) help you?

              Gojir4G Offline
              Gojir4G Offline
              Gojir4
              wrote on last edited by
              #6

              @JonB said in QHelpEngine:

              Or, does the code at https://github.com/srish/QtHelpManual/blob/master/main.cpp (a) work and (b) help you?

              I tried this and it almost works. Almost because only the root link from the index view is working, then I have to use links from the content view to navigate. Links under the root item (children) are not working from the index view and clicking on them add error messages in output:

              QFSFileEngine::open: No file name specified
              QTextBrowser: No document for qthelp://org.qt-project.examples.simpletextviewer/doc/./openfile.html
              

              When using my own documentation .qhc file, nothing is displayed. So I definitely didn't catch the logic here. I guess I will stay with Doxygen for documentation.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved