벡터 변형
QPainterPath 의 요소를 조작하는 방법을 시연합니다.

렌즈 모양의 벡터 변형 필드를 정의하고 이를 경로상의 모든 점에 적용합니다. 즉, 화면에 렌더링되는 것은 픽셀 조작이 아니라 글리프 자체의 수정된 벡터 표현입니다. 이는 변형된 글리프의 안티앨리어싱 처리된 가장자리가 매우 선명하게 표현되는 것에서 확인할 수 있습니다.
상당히 복잡한 경로를 얻기 위해 사용자가 텍스트를 입력하면 이를 경로로 변환하도록 합니다. 이는 QPainterPath::addText() 함수를 사용하여 수행됩니다.
렌즈는 QPainter::drawEllipse() 함수를 한 번 호출하여 그려지며, QRadialGradient 를 사용하여 특수한 색상 테이블로 채워 태양의 반사 효과와 드롭 섀도우 효과를 구현합니다. 성능 향상을 위해 렌즈는 픽스맵으로 캐시됩니다.
© 2026 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.