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. Expanding all items in the QT Assistant TOC tree
Forum Updated to NodeBB v4.3 + New Features

Expanding all items in the QT Assistant TOC tree

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 770 Views 1 Watching
  • 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.
  • P Offline
    P Offline
    pwizard
    wrote on last edited by
    #1

    I'm using Qt Assistant (as a QProcess) to display my app's documentation and I would like to fully expand the Table of Contents tree automatically so the reader can quickly find the section he/she needs.

    Awhile back, I found that passing an "expandToc -1" argument (as a QByteArray) to the running process causes Assistant to expand the tree like I want. The line break at the end of the instruction is necessary (Assistant hangs if I omit it).

    The Assistant QProcess works but the expand instruction isn't very reliable. Once Assistant is running, the tree usually expands for a split second and then collapses down to the root node again (very rarely, the tree stays fully expanded like it's supposed to). It's really annoying because there seems to be no pattern to this bug that would help me solve it.

    Does anybody know why this is happening?

    Here's the code that controls the Assistant process:

    @ QProcess *p=new QProcess();
    QStringList args;

    #ifdef _WIN32
    args << "-collectionFile" << "robojournal.qhc"
    << "-enableRemoteControl";
    #endif

    #ifdef unix
    args << "-collectionFile" << collection_path
    << "-enableRemoteControl";
    #endif
    // Spawn the Assistant process with the OS-specific path-to-binary and args.
    QString exec=assistant + " " + args.join(" ");
    p->start(exec, QIODevice::ReadWrite);

            // Instruct Qt Assistant to completely expand the TOC immediately after launch. This saves
            // the user lots of pointless clicking.
            QByteArray input;
            input.append("expandToc -1\n");
            p->write(input);
    
            if (!p->waitForStarted()){
                return;
            }@
    
    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