Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
src_corelib_io_qdebug.cpp
Go to the documentation of this file.
1
// Copyright (C) 2018 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4
#
include
<
QDebug
>
5
6
void
example
()
7
{
8
//! [0]
9
QString s;
10
11
s =
"a"
;
12
qDebug().noquote() << s;
// prints: a
13
qDebug() << s;
// prints: "a"
14
15
s =
"\"a\r\n\""
;
16
qDebug() << s;
// prints: "\"a\r\n\""
17
18
s =
"\033"
;
// escape character
19
qDebug() << s;
// prints: "\u001B"
20
21
s =
"\u00AD"
;
// SOFT HYPHEN
22
qDebug() << s;
// prints: "\u00AD"
23
24
s =
"\u00E1"
;
// LATIN SMALL LETTER A WITH ACUTE
25
qDebug() << s;
// prints: "á"
26
27
s =
"a\u0301"
;
// "a" followed by COMBINING ACUTE ACCENT
28
qDebug() << s;
// prints: "á";
29
30
s =
"\u0430\u0301"
;
// CYRILLIC SMALL LETTER A followed by COMBINING ACUTE ACCENT
31
qDebug() << s;
// prints: "а́"
32
//! [0]
33
34
//! [1]
35
QByteArray ba;
36
37
ba =
"a"
;
38
qDebug().noquote() << ba;
// prints: a
39
qDebug() << ba;
// prints: "a"
40
41
ba =
"\"a\r\n\""
;
42
qDebug() << ba;
// prints: "\"a\r\n\""
43
44
ba =
"\033"
;
// escape character
45
qDebug() << ba;
// prints: "\x1B"
46
47
ba =
"\xC3\xA1"
;
48
qDebug() << ba;
// prints: "\xC3\xA1"
49
50
ba = QByteArray(
"a\0b"
, 3);
51
qDebug() << ba;
// prints: "\a\x00""b"
52
//! [1]
53
54
QList<QString> list;
55
56
//! [toString]
57
QString str = QDebug::toString(list);
58
//! [toString]
59
}
example
void example()
[5]
Definition
doc_src_groups.cpp:7
qtbase
src
corelib
doc
snippets
code
src_corelib_io_qdebug.cpp
Generated on
for Qt by
1.14.0