Obsolete Members for QString

QString 클래스의 다음 멤버들은 더 이상 사용되지 않습니다. 이 멤버들은 기존 소스 코드가 계속 작동하도록 하기 위해 제공됩니다. 새로운 코드에서는 이를 사용하지 않는 것을 강력히 권장합니다.

공개 함수

(deprecated in 6.4) qsizetype count() const
(deprecated) QString &setUtf16(const ushort *unicode, qsizetype size)
(deprecated) const ushort *utf16() const

정적 공용 멤버

(deprecated in 6.0) QString fromUcs4(const uint *str, qsizetype size = -1)
(deprecated in 6.0) QString fromUtf16(const ushort *str, qsizetype size = -1)

관련 비회원 요소

(since 6.2, deprecated in 6.8) QString operator""_qs(const char16_t *str, size_t size)

멤버 함수 문서

[constexpr, deprecated in 6.4] qsizetype QString::count() const

이 함수는 6.4 버전부터 사용 중단되었습니다. 새로운 코드에서는 이 함수를 사용하지 않는 것을 강력히 권장합니다.

대신 ` size()` 또는 ` length()`를 사용하십시오.

size()와 동일합니다.

이 함수는 QString::count()을 오버로드합니다.

[static, deprecated in 6.0] QString QString::fromUcs4(const uint *str, qsizetype size = -1)

이 함수는 6.0 버전부터 더 이상 사용되지 않습니다. 새로운 코드에서는 이 함수를 사용하지 않는 것을 강력히 권장합니다.

대신 ` char32_t ` 오버로드를 사용하십시오.

[static, deprecated in 6.0] QString QString::fromUtf16(const ushort *str, qsizetype size = -1)

이 함수는 6.0 버전부터 더 이상 사용되지 않습니다. 새로운 코드에서는 이 함수를 사용하지 않는 것을 강력히 권장합니다.

대신 ` char16_t ` 오버로드를 사용하십시오.

[deprecated] QString &QString::setUtf16(const ushort *unicode, qsizetype size)

이 함수는 더 이상 사용되지 않습니다. 새로운 코드에서는 이 함수를 사용하지 않는 것을 강력히 권장합니다.

대신 ` char16_t ` 오버로드를 사용하십시오.

[deprecated] const ushort *QString::utf16() const

이 함수는 더 이상 사용되지 않습니다. 새로운 코드에서는 이 함수를 사용하지 않는 것이 좋습니다.

nullTerminate()를 사용하고, data()의 결과를 const char16_t * 로 형변환하십시오.

QString 를 '\0'로 종료되는 unsigned short 배열로 반환합니다. 결과는 문자열이 수정될 때까지 유효합니다.

반환된 문자열은 호스트 바이트 순서로 되어 있습니다.

setUtf16() 및 unicode()도 참조하십시오 .

관련 비멤버 함수

[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)도 참조하십시오 .

© 2026 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.