In questa pagina

Qt Namespace

Lo spazio dei nomi Qt include i seguenti elementi del modulo QtGui. Lo spazio dei nomi completo è documentato nel modulo QtCore here.

Funzioni

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

Documentazione delle funzioni

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

Converte la stringa di testo semplice plain in un paragrafo formattato in HTML, conservandone gran parte dell'aspetto.

mode Definisce come vengono gestiti gli spazi bianchi.

Questa funzione è definita nel file di intestazione <QTextDocument>.

Vedi anche QString::toHtmlEscaped() e mightBeRichText().

bool Qt::mightBeRichText(QAnyStringView text)

Restituisce ` true ` se la stringa ` text ` sembra essere in formato RTF; altrimenti restituisce ` false`.

Questa funzione utilizza un metodo euristico veloce e quindi semplice. Verifica principalmente se prima del primo ritorno a capo sia presente qualcosa che assomigli a un tag. Sebbene il risultato possa essere corretto nei casi più comuni, non vi è alcuna garanzia.

Questa funzione è definita nel file di intestazione ` <QTextDocument> `.

Nota: nelle versioni di Qt precedenti alla 6.7, questa funzione accettava solo 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.