You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, November 20th 2014, 3:59pm

Qt Assistant in Linux and Mac - unable to call with desired page, unable to use remote

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


Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"
bool Help::startAssistant()
{
// code from Qt site 
   m_helpProcess= new QProcess;
   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")
         << QLatin1String("mycollection.qhc");
     // << QLatin1String("-enableRemoteControl"); can't do this, Assistant freezes
   m_helpProcess->start(app, args);
   if (!m_helpProcess->waitForStarted())
      return;
}
void Help::showSearch() // called from main at selecting menu items
{
   startAssistant();
   QByteArray ba("show search"); // works in windows, but in mac and linux it seems ignored
   m_helpProcess->write(ba);
}"



The -enableRemoteControl option works well in Windows, where selecting a menu item on the application help menu opens the required help page (search, contents, index, about)

I have to replicate the behavior in Linux and mac osx. But there, I had to remove the -enableRemoteControl option because the application freezes.


I found this bug report... https://codereview.qt-project.org/#/c/95279/ that says,


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



It seems there is a patch... for 5.4.


I have to use Qt 4.8... and can't build Qt from source.


Is there a way to apply a patch, or a different way to start Assistant on the desired page at load, without having to use the remote option ?