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. How to get QHelpIndexModel from QHelpEngine?
QtWS25 Last Chance

How to get QHelpIndexModel from QHelpEngine?

Scheduled Pinned Locked Moved General and Desktop
10 Posts 2 Posters 3.6k 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.
  • Z Offline
    Z Offline
    zither
    wrote on last edited by
    #1

    Dear all,

    I would like to get all index list from QHelpEngine. I tried like that but empty return.
    What's wrong with that code?

    @QHelpEngine *engine = new QHelpEngine(QString fileName);
    engine->setupData();
    qDebug()<<engine->filterAttributes; //return all filter attributes
    qDebug()<<engine->indexModel()->stringList(); //empty string list return(error)@

    Thanks

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      zither
      wrote on last edited by
      #2

      @ qDebug()<<Engine->indexModel()->isCreatingIndex(); // return true
      connect(Engine->indexModel(),SIGNAL(indexCreated()),this,SLOT(slotIndexCreate())); //not connect@

      Plz Help
      Thanks

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on last edited by
        #3

        What's the output of the connect statement? Qt prints on stderr (or stdout) a message with a description of the problem if a connect fails.

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          zither
          wrote on last edited by
          #4

          No error message from connect statement. But no call to SLOT.
          Is there any wrong with SIGNAL producer, Engine->indexModel()?
          I can't get also
          @qDebug()<<engine->indexModel()->stringList();@

          Thanks a lot

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on last edited by
            #5

            Maybe a race condition: The help search indexe runs in a separate thread. It could be that the indexing has been finished after your call of isCreatingIndex() (that's why that one returns true) and before the connect statement finishes. That's why the emitted signal is not delivered.

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply
            0
            • Z Offline
              Z Offline
              zither
              wrote on last edited by
              #6

              So, how can I get indexModel from QHelpEngine?
              I try like that but get nothing.
              @Model = Engine->indexModel();
              Widget = Engine->indexWidget();
              newWidget->setModel(Model);
              addWidget(Widget); // no data show
              addWidget(newWidget); // no data show@

              Thanks

              1 Reply Last reply
              0
              • Z Offline
                Z Offline
                zither
                wrote on last edited by
                #7

                Sorry
                @connect(Engine->indexModel(),SIGNAL(indexCreated()),this,SLOT(slotIndexCreate())); // connect
                qDebug()<<Engine->indexModel()->stringList(); //empty "()" return@

                Thanks

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  goetz
                  wrote on last edited by
                  #8

                  Does your help collection load in qt assistant?

                  http://www.catb.org/~esr/faqs/smart-questions.html

                  1 Reply Last reply
                  0
                  • Z Offline
                    Z Offline
                    zither
                    wrote on last edited by
                    #9

                    No, I just don't load help collection in qt assistant.
                    I directly load like that.

                    @QHelpEngine *engine = new QHelpEngine(QString fileName);@

                    So, am I need to load help collection file first?

                    Thanks

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      goetz
                      wrote on last edited by
                      #10

                      You can check whether your help collection is prepared correctly by loading it into Qt Assistant. This way you make sure the data you try to load is sane.

                      http://www.catb.org/~esr/faqs/smart-questions.html

                      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