Utils::AnsiEscapeCodeHandler Class
class Utils::AnsiEscapeCodeHandlerAnsiEscapeCodeHandler 클래스는 텍스트를 분석하여 ANSI 이스케이프 코드를 추출합니다. 더 보기...
| Header: | #include <AnsiEscapeCodeHandler> |
자세한 설명
텍스트 세그먼트 간에 색상 정보를 보존하려면, 스트림이 존재하는 동안 이 클래스의 인스턴스를 유지해야 합니다. 또한, 이 클래스의 하나의 인스턴스가 여러 스트림을 처리해서는 안 됩니다(적어도 동시에 처리해서는 안 됩니다).
이 클래스의 주요 함수는 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.