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.