0

I have an application in Qt, trying to use assistant for help. It is working in windows, trying to make it work on Linux. Using this example

if (process->state() == QProcess::Running)
     return;

 QString app = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QDir::separator();
 #if !defined(Q_OS_MAC)
     app += QLatin1String("assistant");
 #else
     app += QLatin1String("Assistant.app/Contents/MacOS/Assistant");
 #endif

 QStringList args;
 args << QLatin1String("-collectionFile")
      << "theHelpFile.qhc"
      << QLatin1String("-enableRemoteControl");
 process->start(app, args);
 if (!process->waitForStarted()) {
     QMessageBox::critical(this, tr("Remote Control"),
         tr("Could not start Qt Assistant from %1.").arg(app));
     return;
 }

There is no error, I get an open window - non-responsive and empty.

If I remove the "-enableRemoteControl" option, it works.

Running

/usr/bin/assistant -collectionFile theHelpFile.qhc -enableRemoteControl

launches the assistant with the correct help collection.

What am I doing wrong ? Is the "-enableRemoteControl" option necessary ?

Qt documentation says that "In order to make Assistant listen to your application, turn on its remote control functionality by passing the -enableRemoteControl command line option."

But... it is working from my application without that option... and not working with it ?

Can anybody please explain why ?

Rubén
  • 34,714
  • 9
  • 70
  • 166
Thalia
  • 13,637
  • 22
  • 96
  • 190
  • Maybe it expects you to send an initial command, but this anyhow sounds like a bug. You only need that option if you want to allow your application to load help pages later on, once assistant is already started. So if you only want to start it once, just don't use that option. – jturcotte Nov 13 '14 at 19:32
  • Unfortunately I have to mimic the behavior in windows, where I can tell assistant what page to start on - and I can only do that after Assistant has started I think (please see linked question) – Thalia Nov 20 '14 at 15:30

1 Answers1

0

Seems it is a bug that has been addressed recently

https://codereview.qt-project.org/#/c/95279/

"Commit message:

Assistant: Fix index updating on startup in the remote control mode

HelpEngineWrapper::initialDocSetupDone() should be called only once right after the initialization of the help models. Calling it on every small update leads to recursion."

Fixed for Qt 5.4 though... I am stuck using 4.8... So I may not be able to solve the problem...

Thalia
  • 13,637
  • 22
  • 96
  • 190