Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
process.cpp
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4
#
include
<
QProcess
>
5
6
bool
zip
()
7
{
8
//! [0]
9
QProcess gzip;
10
gzip.start(
"gzip"
, QStringList() <<
"-c"
);
11
if
(!gzip.waitForStarted())
12
return
false
;
13
14
gzip.write(
"Qt rocks!"
);
15
gzip.closeWriteChannel();
16
17
if
(!gzip.waitForFinished())
18
return
false
;
19
20
QByteArray result = gzip.readAll();
21
//! [0]
22
23
gzip.start(
"gzip"
, QStringList() <<
"-d"
<<
"-c"
);
24
gzip.write(result);
25
gzip.closeWriteChannel();
26
27
if
(!gzip.waitForFinished())
28
return
false
;
29
30
qDebug(
"Result: %s"
, gzip.readAll().data());
31
return
true
;
32
}
33
34
35
int
main
()
36
{
37
zip
(
)
;
38
return
0;
39
}
main
int main()
[open]
Definition
doc_src_objecttrees.cpp:7
zip
bool zip()
Definition
process.cpp:6
qtbase
src
corelib
doc
snippets
process
process.cpp
Generated on
for Qt by
1.18.0