Utils::AnsiEscapeCodeHandler Class
class Utils::AnsiEscapeCodeHandlerAnsiEscapeCodeHandler クラスは、テキストを解析し、そこから ANSI エスケープコードを抽出します。詳細...
| Header: | #include <AnsiEscapeCodeHandler> |
詳細な説明
テキストセグメント間で色情報を保持するためには、ストリームの存続期間中、このクラスのインスタンスを保持しておく必要があります。また、このクラスの 1 つのインスタンスで複数のストリームを処理してはなりません(少なくとも同時には)。
主な関数は parseText() で、テキストとデフォルトの `QTextCharFormat` を受け取ります。この関数は、テキストを解析し、色付きテキストを小さな文字列に分割し、それぞれの適切な書式情報を `QTextCharFormat` 内に設定するように設計されています。
使用方法:
- ストリームに対して AnsiEscapeCodeHandler の新しいインスタンスを作成します。
- 新しいテキストを追加するには、テキストとデフォルトのQTextCharFormat を引数としてparseText()を呼び出します。この関数の結果は、適切な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.