aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/code/tools_assistant_compat_lib_qassistantclient.cpp
blob: 8460627bba463d592d6461c63cba7526ad9b7e16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

//! [0]
        QProcess *process = new QProcess(this);
        QString app = QLibraryInfo::path(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]