0

我在 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 命令行选项来打开其远程控制功能。”

但是......它在我的应用程序中没有那个选项......而不是使用它?

有人可以解释为什么吗?

4

1 回答 1

0

似乎这是最近已解决的错误

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

“提交消息:

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

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

虽然已针对 Qt 5.4 进行了修复...我被 4.8 卡住了...所以我可能无法解决问题...

于 2014-11-20T15:25:56.513 回答