Qt Assistant fails in linux with enableRemoteControl option

227 views Asked by At

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 ?

1

There are 1 answers

0
Thalia On

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...