Na tej strani

Utils::AnsiEscapeCodeHandler Class

class Utils::AnsiEscapeCodeHandler

Razred AnsiEscapeCodeHandler analizira besedilo in iz njega izloči ANSI-escape kode. Več...

Header: #include <AnsiEscapeCodeHandler>

Podroben opis

Da bi ohranili informacije o barvah v posameznih segmentih besedila, mora biti instanca tega razreda shranjena za celotno trajanje toka. Prav tako ena instanca tega razreda ne sme obdelovati več tokov hkrati (vsaj ne istočasno).

Njena glavna funkcija je `parseText()`, ki sprejme besedilo in privzeto ` QTextCharFormat`. Ta funkcija je zasnovana za razčlenjevanje besedila in razdeljevanje obarvanega besedila na manjše nize, pri čemer so ustrezne informacije o oblikovanju shranjene znotraj ` QTextCharFormat`.

Uporaba:

  • Ustvarite novo instanco AnsiEscapeCodeHandler za tok.
  • Za dodajanje novega besedila pokličite parseText() s besedilom in privzetim QTextCharFormat. Rezultat te funkcije je seznam nizov z oblikami, nastavljenimi v ustreznih 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.