我在 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 命令行选项来打开其远程控制功能。”
但是......它在我的应用程序中没有那个选项......而不是使用它?
有人可以解释为什么吗?