이 페이지에서

Qt Namespace

Qt 네임스페이스에는 QtGui 모듈의 다음 요소들이 포함됩니다. 전체 네임스페이스에 대한 설명은 QtCore 모듈에 나와 있습니다. here.

함수

QString convertFromPlainText(const QString &plain, Qt::WhiteSpaceMode mode = WhiteSpacePre)
bool mightBeRichText(QAnyStringView text)

함수 문서

QString Qt::convertFromPlainText(const QString &plain, Qt::WhiteSpaceMode mode = WhiteSpacePre)

plain 라는 일반 텍스트 문자열을 HTML 형식의 단락으로 변환하면서, 그 모양을 대부분 유지합니다.

mode 공백 처리 방식을 정의합니다.

이 함수는 <QTextDocument> 헤더 파일에 정의되어 있습니다.

QString::toHtmlEscaped() 및 mightBeRichText()도 참조하십시오 .

bool Qt::mightBeRichText(QAnyStringView text)

문자열 ` text `이 서식 있는 텍스트일 가능성이 높으면 ` true `을 반환하고, 그렇지 않으면 ` false`을 반환합니다.

이 함수는 빠르고 따라서 간단한 휴리스틱을 사용합니다. 주로 첫 번째 줄 바꿈 앞에 태그처럼 보이는 것이 있는지 확인합니다. 일반적인 경우에는 결과가 정확할 수 있지만, 보장되지는 않습니다.

이 함수는 ` <QTextDocument> ` 헤더 파일에 정의되어 있습니다.

참고: Qt 6.7 이전버전에서는 이 함수가 QString 만 입력으로 받았습니다.

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