Qt
6.x
The Qt SDK
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
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: "а́"
29
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"
49
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
)));
QByteArray
\inmodule QtCore
Definition
qbytearray.h:57
QList::isEmpty
bool isEmpty() const noexcept
Definition
qlist.h:390
QString
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition
qstring.h:127
QString::fromLatin1
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition
qstring.cpp:5710
s
GLdouble s
[6]
Definition
qopenglext.h:235
arg
SSL_CTX int(*) void arg)
Definition
qsslsocket_openssl_symbols.cpp:404
qPrintable
#define qPrintable(string)
Definition
qstring.h:1391
QTRY_VERIFY2
#define QTRY_VERIFY2(expr, messageExpression)
Definition
qtestcase.h:201
list
QList< int > list
[14]
Definition
src_concurrent_qtconcurrentfilter.cpp:140
s
QString s
[0]
Definition
src_corelib_io_qdebug.cpp:5
ba
QByteArray ba
[0]
Definition
src_corelib_io_qdebug.cpp:31
qDebug
qDebug().noquote()<< s
[1]
qtbase
src
corelib
doc
snippets
code
src_corelib_io_qdebug.cpp
Generated by
1.9.7