QCanvasBrush Class
QCanvasBrush は、QCanvasPainter のすべての塗りつぶし/ストロークブラシの基底クラスです。詳細...
| ヘッダー: | #include <QCanvasBrush> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS CanvasPainter) target_link_libraries(mytarget PRIVATE Qt6::CanvasPainter) |
| 以下より: | Qt 6.11 |
パブリック型
| enum class | BrushType { Invalid, LinearGradient, RadialGradient, ConicalGradient, BoxGradient, …, Custom } |
パブリック関数
| QCanvasBrush() | |
| QCanvasBrush(QCanvasImage &&other) | |
| QCanvasBrush(const QCanvasBrush &brush) | |
| QCanvasBrush(QCanvasBrush &&other) | |
| void | swap(QCanvasBrush &other) |
| QCanvasBrush::BrushType | type() const |
| QCanvasBrush & | operator=(QCanvasBrush &&other) |
| QCanvasBrush & | operator=(const QCanvasBrush &brush) |
関連する非メンバー
| bool | operator!=(const QCanvasBrush &lhs, const QCanvasBrush &rhs) |
| bool | operator==(const QCanvasBrush &lhs, const QCanvasBrush &rhs) |
詳細な説明
QCanvasBrush は、QCanvasPainter::fill() およびQCanvasPainter::stroke() で使用されるすべてのスタイルの基底クラスです。
メンバ型のドキュメント
enum class QCanvasBrush::BrushType
ブラシの種類を指定します。
| 定数 | 値 | 説明 |
|---|---|---|
QCanvasBrush::BrushType::Invalid | 0 | - 空のブラシ。 |
QCanvasBrush::BrushType::LinearGradient | 1 | - 開始点と終了点の間で色を補間します (QCanvasLinearGradient) |
QCanvasBrush::BrushType::RadialGradient | 2 | - 焦点と、その周囲を囲む円上の終点との間で色を補間します (QCanvasRadialGradient)。 |
QCanvasBrush::BrushType::ConicalGradient | 3 | - 中心点周辺のカラーを補間します(QCanvasConicalGradient )。 |
QCanvasBrush::BrushType::BoxGradient | 4 | - 丸みを帯びた長方形上で色を補間します(QCanvasBoxGradient )。 |
QCanvasBrush::BrushType::BoxShadow | 5 | - 柔らかい丸みを帯びた長方形の影を作成します (QCanvasBoxShadow)。 |
QCanvasBrush::BrushType::ImagePattern | 6 | - 指定した画像と繰り返し設定を使用してパターンを作成します(QCanvasImagePattern )。 |
QCanvasBrush::BrushType::GridPattern | 7 | - 指定したグリッドを使用してパターンを作成します (QCanvasGridPattern)。 |
QCanvasBrush::BrushType::Custom | 1000 | - カスタムシェーダーブラシを作成します(QCanvasCustomBrush )。 |
type()も参照してください 。
メンバ関数のドキュメント
QCanvasBrush::QCanvasBrush()
無効なブラシを作成します。
[noexcept implicit] QCanvasBrush::QCanvasBrush(QCanvasImage &&other)
other から新しい QCanvasBrush を移動生成します。
QCanvasBrush::QCanvasBrush(const QCanvasBrush &brush)
指定されたbrush のコピーであるブラシを作成します。
[constexpr noexcept default] QCanvasBrush::QCanvasBrush(QCanvasBrush &&other)
QCanvasBrush のインスタンスをMoveコンストラクタで生成します。
[noexcept] void QCanvasBrush::swap(QCanvasBrush &other)
このブラシをother と入れ替えます。この操作は非常に高速で、失敗することはありません。
QCanvasBrush::BrushType QCanvasBrush::type() const
ブラシの型を返します。
[noexcept] QCanvasBrush &QCanvasBrush::operator=(QCanvasBrush &&other)
other をこのQCanvasBrush インスタンスに割り当てます。
QCanvasBrush &QCanvasBrush::operator=(const QCanvasBrush &brush)
指定されたbrush をこのブラシに割り当て、このブラシへの参照を返します。
関連する非メンバー
[noexcept] bool operator!=(const QCanvasBrush &lhs, const QCanvasBrush &rhs)
ブラシ `lhs ` が `rhs` と異なる場合は `true ` を返し、それ以外の場合は `false ` を返します。
operator==()も参照してください 。
[noexcept] bool operator==(const QCanvasBrush &lhs, const QCanvasBrush &rhs)
ブラシ `lhs ` が `rhs` と等しい場合は `true ` を返し、それ以外の場合は `false ` を返します。
ブラシは値によって比較され、2つのQCanvasBrush を比較すると、それらが生成された具体的なブラシ(例:QCanvasGridPattern )を比較した場合と同じ結果が得られます。
operator!=()も参照してください 。
© 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.