In questa pagina

Utils::AnsiEscapeCodeHandler Class

class Utils::AnsiEscapeCodeHandler

La classe AnsiEscapeCodeHandler analizza il testo ed estrae da esso i codici di escape ANSI. Per saperne di più...

Header: #include <AnsiEscapeCodeHandler>

Descrizione dettagliata

Per preservare le informazioni sul colore tra i segmenti di testo, è necessario mantenere un'istanza di questa classe per tutta la durata di un flusso. Inoltre, un'istanza di questa classe non dovrebbe gestire più flussi (almeno non contemporaneamente).

La sua funzione principale è `parseText()`, che accetta un testo e un valore predefinito per ` QTextCharFormat`. Questa funzione è progettata per analizzare il testo e suddividere il testo colorato in stringhe più piccole, con le relative informazioni di formattazione impostate all'interno di ` QTextCharFormat`.

Utilizzo:

  • Creare una nuova istanza di `AnsiEscapeCodeHandler` per uno stream.
  • Per aggiungere nuovo testo, chiamare parseText() con il testo e un QTextCharFormat predefinito. Il risultato di questa funzione è un elenco di stringhe con i formati impostati negli appositi QTextCharFormat.

Copyright © The Qt Company Ltd. and other contributors. 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.