Protobuf Qt GUI Types Module
프로토뷰에서 네이티브 Qt GUI 유형을 사용할 수 있도록 지원합니다. 더 보기...
이 모듈은 Qt 6.6에 도입되었습니다.
자세한 설명
Qt::ProtobufQtGuiTypes는 미리 정의된 protobuf 메시지가 있는 라이브러리로, 선택된 Qt GUI 유형을 캡슐화하도록 설계되었습니다.
지원되는 Qt GUI 유형 목록입니다:
Qt GUI 사용법
Qt GUI 유형 지원을 활성화하려면 CMake 프로젝트에 ProtobufQtGuiTypes를 종속성으로 추가합니다:
... find_package(Qt REQUIRED COMPONENTS Protobuf ProtobufQtGuiTypes) ... # After target creation target_link_libraries(${TARGET} PRIVATE Qt::ProtobufQtGuiTypes)
Qt GUI 타입을 필드로 사용하는 메시지를 직렬화하거나 역직렬화하기 전에 등록 메서드를 호출하세요:
// e.g. in main.cpp QtProtobuf::qRegisterProtobufQtGuiTypes(); ...
지원되는 모든 메시지는 Qt GUI 모듈의 Qt 유형을 설명하는 특수 .proto 파일( QtGui.proto)에 설명되어 있습니다.
이 파일을 사용하여 다른 언어나 프레임워크용 코드를 생성할 수도 있습니다.
예를 들어 인터페이스 .proto 파일에서 필요한 Qt GUI 유형 모듈을 가져옵니다:
syntax = "proto3"; package project.module.component; import "QtGui/QtGui.proto"; message QMatrix4x4Message { QtGui.QMatrix4x4 matrix = 1; }
Qt Protobuf 생성기는 ProtobufQtGuiTypes 패키지에서 제공하는 Qt GUI 유형을 감지하고 이를 직접 사용합니다. 따라서 추가 변환 없이 이러한 유형을 유연하게 사용할 수 있습니다.
Q이미지 직렬화
ProtobufQtGuiTypes 라이브러리는 QImage 클래스로 작업할 수 있는 기능을 제공합니다. 일반적으로 라이브러리는 모든 QImage 객체를 PNG
형식으로 변환합니다. 그러나 https://doc.qt.io/qt-6/qimage.html#Format-enum {부동 소수점 형식}을 사용하여 QImage 을 생성한 경우 PNG
로 변환하면 데이터가 손실됩니다. 데이터 손실을 방지하기 위해 라이브러리는 시스템에서 지원되는 경우 이미지 파일을 TIFF
형식으로 자동 변환하고, 그렇지 않은 경우 PNG
형식으로 변환합니다.
참고: TIFF
를 사용하지 않으려면 이미지를 부동 소수점 형식이 아닌 형식으로 명시적으로 변환해야 합니다.
© 2025 The Qt Company Ltd. 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.