Na této stránce

Utils::AnsiEscapeCodeHandler Class

class Utils::AnsiEscapeCodeHandler

Třída AnsiEscapeCodeHandler analyzuje text a extrahuje z něj ANSI escape kódy. Více...

Header: #include <AnsiEscapeCodeHandler>

Podrobný popis

Aby byly zachovány informace o barvách napříč textovými segmenty, musí být instance této třídy uložena po celou dobu existence proudu. Jedna instance této třídy by také neměla zpracovávat více proudů (alespoň ne současně).

Její hlavní funkcí je parseText(), která přijímá text a výchozí hodnotu QTextCharFormat. Tato funkce je určena k analýze textu a rozdělení barevného textu na menší řetězce, přičemž příslušné informace o formátování jsou uloženy v QTextCharFormat.

Použití:

  • Vytvořte novou instanci třídy `AnsiEscapeCodeHandler` pro daný stream.
  • Chcete-li přidat nový text, zavolejte funkci parseText() s textem a výchozím objektem QTextCharFormat. Výsledkem této funkce je seznam řetězců s formáty nastavenými v příslušných objektech 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.