ベクトルの変形
QPainterPath の要素を操作する方法を示します。

レンズ状のベクトル変形場を定義し、これをパス上のすべての点に適用します。つまり、画面上にレンダリングされるのはピクセルの操作ではなく、グリフそのものの変形されたベクトル表現です。これは、変形されたグリフのアンチエイリアス処理されたエッジの高品質さからも確認できます。
かなり複雑なパスを作成するために、ユーザーがテキストを入力し、そのテキストをパスに変換できるようにしています。これはQPainterPath::addText()関数を使用して行われます。
レンズの描画には、QPainter::drawEllipse() を 1 回呼び出し、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.