Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    How to get QHelpIndexModel from QHelpEngine?

    General and Desktop
    2
    10
    2972
    Loading More Posts
    • 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
      zither last edited by

      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 Reply Quote 0
      • Z
        zither last edited by

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

        Plz Help
        Thanks

        1 Reply Last reply Reply Quote 0
        • G
          goetz last edited by

          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 Reply Quote 0
          • Z
            zither last edited by

            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 Reply Quote 0
            • G
              goetz last edited by

              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 Reply Quote 0
              • Z
                zither last edited by

                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 Reply Quote 0
                • Z
                  zither last edited by

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

                  Thanks

                  1 Reply Last reply Reply Quote 0
                  • G
                    goetz last edited by

                    Does your help collection load in qt assistant?

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

                    1 Reply Last reply Reply Quote 0
                    • Z
                      zither last edited by

                      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 Reply Quote 0
                      • G
                        goetz last edited by

                        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 Reply Quote 0
                        • First post
                          Last post