使用enableRemoteControl选项,Qt Assistant在linux中失败

Qt Assistant fails in linux with enableRemoteControl option

本文关键字:linux 失败 Assistant Qt enableRemoteControl 选项 使用      更新时间:2023-10-16

我在Qt中有一个应用程序,试图使用助手来获得帮助。它在windows下工作,试图让它在Linux上工作。使用此示例

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;
 }

没有错误,我得到了一个打开的窗口-没有响应并且是空的。

如果我去掉"-enableRemoteControl"选项,它就会起作用。

运行

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

启动带有正确帮助集合的助手。

我做错了什么?是否需要"-enableRemoteControl"选项?

Qt文档说:"为了让Assistant监听你的应用程序,通过传递-enableRemoteControl命令行选项来打开它的远程控制功能。"

但是。。。它在我的应用程序中工作,没有这个选项。。。而不使用它?

谁能解释一下原因吗?

这似乎是最近解决的一个错误

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

"提交消息:

助手:修复在远程控制模式启动时的索引更新

HelpEngineWrapper::initialDocSetupDone()只能调用一次在帮助模型初始化之后。打开它每次小的更新都会导致递归。"

修正了Qt 5.4。。。我一直在使用4.8…所以我可能无法解决问题。。。