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
//! [0]
5
QString
s
;
6
7
s
=
"a"
;
8
qDebug().noquote() << s;
// prints: a
9
qDebug() << s;
// prints: "a"
10
11
s
=
"\"a\r\n\""
;
12
qDebug() << s;
// prints: "\"a\r\n\""
13
14
s
=
"\033"
;
// escape character
15
qDebug() << s;
// prints: "\u001B"
16
17
s
=
"\u00AD"
;
// SOFT HYPHEN
18
qDebug() << s;
// prints: "\u00AD"
19
20
s
=
"\u00E1"
;
// LATIN SMALL LETTER A WITH ACUTE
21
qDebug() << s;
// prints: "á"
22
23
s
=
"a\u0301"
;
// "a" followed by COMBINING ACUTE ACCENT
24
qDebug() << s;
// prints: "á";
25
26
s
=
"\u0430\u0301"
;
// CYRILLIC SMALL LETTER A followed by COMBINING ACUTE ACCENT
27
qDebug() << s;
// prints: "а́"
28
//! [0]
29
30
//! [1]
31
QByteArray
ba
;
32
33
ba
=
"a"
;
34
qDebug().noquote() << ba;
// prints: a
35
qDebug() << ba;
// prints: "a"
36
37
ba
=
"\"a\r\n\""
;
38
qDebug() << ba;
// prints: "\"a\r\n\""
39
40
ba
=
"\033"
;
// escape character
41
qDebug() << ba;
// prints: "\x1B"
42
43
ba
=
"\xC3\xA1"
;
44
qDebug() << ba;
// prints: "\xC3\xA1"
45
46
ba
= QByteArray(
"a\0b"
, 3);
47
qDebug() << ba
// prints: "\a\x00""b"
48
//! [1]
49
50
//! [toString]
51
QTRY_VERIFY2(list.isEmpty(), qPrintable(QString::fromLatin1(
52
"Expected list to be empty, but it has the following items: %1"
)).arg(QDebug::toString(list)));
53
//! [toString]
s
QString s
[0]
Definition
src_corelib_io_qdebug.cpp:5
ba
QByteArray ba
[0]
Definition
src_corelib_io_qdebug.cpp:31
qtbase
src
corelib
doc
snippets
code
src_corelib_io_qdebug.cpp
Generated on Thu Nov 14 2024 00:38:52 for Qt by
1.12.0