Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
src_corelib_text_qstring.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
4using namespace Qt::StringLiterals;
5
7QString url = "https://www.unicode.org/"_L1;
9
10
12double d = 12.34;
13QString str = QString("delta: %1").arg(d, 0, 'E', 3);
14// str == "delta: 1.234E+01"
16
17
19if (str == "auto" || str == "extern"
20 || str == "static" || str == "register") {
21 ...
22}
24
25
27if (str == QString("auto") || str == QString("extern")
28 || str == QString("static") || str == QString("register")) {
29 ...
30}
32
34str.append("Hello ").append("World");
36
38if (str == "auto"_L1
39 || str == "extern"_L1
40 || str == "static"_L1
41 || str == "register"_L1 {
42 ...
43}
45
46
48QLabel *label = new QLabel("MOD"_L1, this);
50
51
53QString plain = "#include <QtCore>"
54QString html = plain.toHtmlEscaped();
55// html == "#include &lt;QtCore&gt;"
57
59QString str("ab");
60str.repeated(4); // returns "abababab"
62
64// hasAttribute takes a QString argument
65if (node.hasAttribute("http-contents-length")) //...
67
69if (node.hasAttribute(QStringLiteral(u"http-contents-length"))) //...
71
73if (attribute.name() == "http-contents-length"_L1) //...
75
79
The QLabel widget provides a text or image display.
Definition qlabel.h:20
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QString repeated(qsizetype times) const
Definition qstring.cpp:8375
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
Definition qstring.cpp:8870
QString & append(QChar c)
Definition qstring.cpp:3252
QString toHtmlEscaped() const
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
EGLOutputLayerEXT EGLint attribute
#define qWarning
Definition qlogging.h:166
GLuint64 key
GLuint GLsizei const GLchar * label
[43]
#define qUtf8Printable(string)
Definition qstring.h:1535
#define qUtf16Printable(string)
Definition qstring.h:1543
#define QStringLiteral(str)
QString url
[1]
double d
[1]