• 5693阅读
  • 1回复

关于QAssistantClient::showPage函数的问题。。 [复制链接]

上一主题 下一主题
离线mrlee321
 
只看楼主 倒序阅读 楼主  发表于: 2010-04-30
我今天调用showPage函数来打开一个.html的帮助文档..

函数如下:
assistantClient->showPage("/opt/test/help.html");

可惜失败了..一点反应都没有..就是打不开..不知道是什么原因..有人遇到过这种情况么?

那个大牛知道解决办法..或者提供一个思路让我自己去解决....谢谢了先。。
离线foxyz

只看该作者 1楼 发表于: 2010-04-30
现在好像不推荐使用这个class了阿!
The QAssistantClient class provides a means of using Qt Assistant as an application's help tool.

Note: This class is obsolete and only required when using the old Qt Assistant, now called assistant_adp. If you want to use the new Qt Assistant as a remote help viewer, simple create a QProcess instance and specify assistant as its executable. The following code shows how to start Qt Assistant and request a certain page to be shown:

         QProcess *process = new QProcess(this);
         QString app = QLibraryInfo::location(QLibraryInfo::BinariesPath)
             + QLatin1String("/assistant");

         process->start(app, QStringList() << QLatin1String("-enableRemoteControl"));
         if (!process->waitForStarted()) {
             QMessageBox::critical(this, tr("Remote Control"),
                 tr("Could not start Qt Assistant from %1.").arg(app));
             return;
         }

         // show index page
         QTextStream str(process);
         str << QLatin1String("SetSource qthelp://mycompany.com/doc/index.html")
             << QLatin1Char('\0') << endl;
     }
For a complete example using the Qt Assistant remotely, see the Remote Control example.
快速回复
限100 字节
 
上一个 下一个