Obsolete Members for QtLiterals
QtLiterals 클래스의 다음 멤버는 더 이상 사용되지 않습니다. 이들은 이전 소스 코드의 작동을 유지하기 위해 제공됩니다. 새 코드에서는 사용하지 않는 것이 좋습니다.
함수
(since 6.2, deprecated in 6.8) QByteArray | operator""_qba(const char *str, size_t size) |
(since 6.2, deprecated in 6.8) QString | operator""_qs(const char16_t *str, size_t size) |
함수 문서
[noexcept, since 6.2, deprecated in 6.8]
QByteArray operator""_qba(const char *str, size_t size)
이 함수는 6.8부터 더 이상 사용되지 않습니다. 새 코드에서 이 함수를 사용하지 않는 것이 좋습니다.
대신 Qt::StringLiterals 네임스페이스에서 _ba
을 사용하십시오.
문자 문자열 리터럴 str 의 첫 size 문자로 QByteArray 을 만드는 리터럴 연산자입니다.
QByteArray 은 컴파일 시 생성되며, 생성된 문자열 데이터는 컴파일된 객체 파일의 읽기 전용 세그먼트에 저장됩니다. 중복 리터럴은 동일한 읽기 전용 메모리를 공유할 수 있습니다. 이 기능은 QByteArrayLiteral 와 호환되지만 코드에 많은 문자열 리터럴이 있을 때 타이핑을 절약할 수 있습니다.
다음 코드는 QByteArray 을 생성합니다:
auto str = "hello"_qba;
이 함수는 Qt 6.2에 도입되었습니다.
QByteArrayLiteral 및 QtLiterals::operator""_qs(const char16_t *str, size_t size)도 참조하세요 .
[noexcept, since 6.2, deprecated in 6.8]
QString operator""_qs(const char16_t *str, size_t size)
이 함수는 6.8부터 더 이상 사용되지 않습니다. 새 코드에서 이 함수를 사용하지 않는 것이 좋습니다.
대신 Qt::StringLiterals 네임스페이스에서 _s
을 사용하십시오.
char16_t 문자열 리터럴 str 의 첫 size 문자로 QString 을 생성하는 리터럴 연산자입니다.
QString 은 컴파일 시 생성되며, 생성된 문자열 데이터는 컴파일된 객체 파일의 읽기 전용 세그먼트에 저장됩니다. 중복 리터럴은 동일한 읽기 전용 메모리를 공유할 수 있습니다. 이 기능은 QStringLiteral 와 호환되지만 코드에 많은 문자열 리터럴이 있을 때 타이핑을 절약할 수 있습니다.
다음 코드는 QString 을 생성합니다:
auto str = u"hello"_qs;
이 함수는 Qt 6.2에 도입되었습니다.
QStringLiteral 및 QtLiterals::operator""_qba(const char *str, size_t size)도 참조하세요 .
© 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.