Literals Namespace

Qt::Literals

Der Inline-Namespace Literals deklariert Literaloperatoren für Qt-Typen. Mehr...

Kopfzeile: #include <QString>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core

Namespaces

namespace StringLiterals

Detaillierte Beschreibung

Namespaces

namespace Literals::StringLiterals

Der Inline-Namespace Qt::Literals::StringLiterals deklariert String-Literal-Operatoren für Qt-Typen. Da sowohl der Literals als auch der StringLiterals Namespace als inline deklariert sind, kann auf die Symbole aus diesem Namespace zugegriffen werden, indem Sie eines der folgenden Symbole zu Ihrem Code hinzufügen:

// Makes visible only the literal operators declared in StringLiterals
using namespace Qt::Literals::StringLiterals;

// Makes visible literal operators declared in all inline namespaces
// inside Literals
using namespace Qt::Literals;

// Makes visible all symbols (including all literal operators) declared
// in the Qt namespace
using namespace Qt;

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.