diff options
Diffstat (limited to 'doc/src/snippets/code/tools_assistant_compat_lib_qassistantclient.cpp')
-rw-r--r-- | doc/src/snippets/code/tools_assistant_compat_lib_qassistantclient.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/src/snippets/code/tools_assistant_compat_lib_qassistantclient.cpp b/doc/src/snippets/code/tools_assistant_compat_lib_qassistantclient.cpp new file mode 100644 index 0000000..f5097a9 --- /dev/null +++ b/doc/src/snippets/code/tools_assistant_compat_lib_qassistantclient.cpp @@ -0,0 +1,25 @@ +//! [0] + 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; + } +//! [0] + + +//! [1] + CONFIG += assistant +//! [1] + + |