Qt Namespace
L'espace de noms Qt comprend les éléments suivants issus du module QtGui. L'espace de noms complet est documenté dans le module QtCore here.
Fonctions
| QString | convertFromPlainText(const QString &plain, Qt::WhiteSpaceMode mode = WhiteSpacePre) |
| bool | mightBeRichText(QAnyStringView text) |
Documentation des fonctions
QString Qt::convertFromPlainText(const QString &plain, Qt::WhiteSpaceMode mode = WhiteSpacePre)
Convertit la chaîne de texte brut « plain » en un paragraphe au format HTML tout en conservant l'essentiel de son aspect.
mode Définit la manière dont les espaces sont gérés.
Cette fonction est définie dans le fichier d'en-tête <QTextDocument>.
Voir également QString::toHtmlEscaped() et mightBeRichText().
bool Qt::mightBeRichText(QAnyStringView text)
Renvoie « true » si la chaîne « text » est susceptible d'être du texte enrichi ; sinon, renvoie « false ».
Cette fonction utilise une heuristique rapide et donc simple. Elle vérifie principalement s’il existe un élément ressemblant à une balise avant le premier saut de ligne. Bien que le résultat puisse être correct dans les cas courants, il n’y a aucune garantie.
Cette fonction est définie dans le fichier d'en-tête « <QTextDocument> ».
Remarque : dans les versions de Qt antérieures à la version 6.7, cette fonction n'acceptait que 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.