QCanvasBrush Class
QCanvasBrush ist die Basisklasse für alle Füll- und Konturpinsel von „ QCanvasPainter “. Mehr...
| Überschrift: | #include <QCanvasBrush> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS CanvasPainter) target_link_libraries(mytarget PRIVATE Qt6::CanvasPainter) |
| Seit: | Qt 6.11 |
Öffentliche Typen
| enum class | BrushType { Invalid, LinearGradient, RadialGradient, ConicalGradient, BoxGradient, …, Custom } |
Öffentliche Funktionen
| 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) |
Verwandte Nicht-Mitglieder
| bool | operator!=(const QCanvasBrush &lhs, const QCanvasBrush &rhs) |
| bool | operator==(const QCanvasBrush &lhs, const QCanvasBrush &rhs) |
Ausführliche Beschreibung
QCanvasBrush ist die Basisklasse für alle Stile, die für QCanvasPainter::fill() und QCanvasPainter::stroke() verwendet werden.
Dokumentation zu den Mitgliedstypen
enum class QCanvasBrush::BrushType
Legt den Pinseltyp fest.
| Konstante | Wert | Beschreibung |
|---|---|---|
QCanvasBrush::BrushType::Invalid | 0 | - Leerer Pinsel. |
QCanvasBrush::BrushType::LinearGradient | 1 | - Interpoliert Farben zwischen Start- und Endpunkt (QCanvasLinearGradient) |
QCanvasBrush::BrushType::RadialGradient | 2 | - Interpoliert Farben zwischen einem Mittelpunkt und den Endpunkten eines ihn umgebenden Kreises (QCanvasRadialGradient). |
QCanvasBrush::BrushType::ConicalGradient | 3 | - Interpoliert Farben um einen Mittelpunkt herum (QCanvasConicalGradient). |
QCanvasBrush::BrushType::BoxGradient | 4 | - Interpoliert Farben auf einem abgerundeten Rechteck (QCanvasBoxGradient). |
QCanvasBrush::BrushType::BoxShadow | 5 | - Erstellt einen weichen, runden Rechteck-Schatten (QCanvasBoxShadow). |
QCanvasBrush::BrushType::ImagePattern | 6 | - Erstellt ein Muster unter Verwendung des angegebenen Bildes und der angegebenen Wiederholungshäufigkeit (QCanvasImagePattern). |
QCanvasBrush::BrushType::GridPattern | 7 | - Erstellt ein Muster anhand des angegebenen Rasters (QCanvasGridPattern). |
QCanvasBrush::BrushType::Custom | 1000 | - Erstellt einen benutzerdefinierten Shader-Pinsel (QCanvasCustomBrush). |
Siehe auch type().
Dokumentation der Mitgliedsfunktionen
QCanvasBrush::QCanvasBrush()
Erstellt einen ungültigen Pinsel.
[noexcept implicit] QCanvasBrush::QCanvasBrush(QCanvasImage &&other)
Erstellt ein neues `QCanvasBrush`-Objekt aus ` other`.
QCanvasBrush::QCanvasBrush(const QCanvasBrush &brush)
Erstellt einen Pinsel, der eine Kopie des angegebenen „ brush “ ist.
[constexpr noexcept default] QCanvasBrush::QCanvasBrush(QCanvasBrush &&other)
Erzeugt eine Instanz von ` QCanvasBrush` mithilfe des Move-Konstruktors.
[noexcept] void QCanvasBrush::swap(QCanvasBrush &other)
Ersetzt diesen Pinsel durch „ other “. Dieser Vorgang ist sehr schnell und schlägt nie fehl.
QCanvasBrush::BrushType QCanvasBrush::type() const
Gibt den Typ des Pinsels zurück.
[noexcept] QCanvasBrush &QCanvasBrush::operator=(QCanvasBrush &&other)
Weist „ other “ dieser Instanz von „ QCanvasBrush “ zu.
QCanvasBrush &QCanvasBrush::operator=(const QCanvasBrush &brush)
Weist diesem Pinsel den angegebenen „ brush “ zu und gibt eine Referenz auf diesen Pinsel zurück.
Verwandte Nicht-Mitglieder
[noexcept] bool operator!=(const QCanvasBrush &lhs, const QCanvasBrush &rhs)
Gibt „ true “ zurück, wenn sich die Pinsel-ID „ lhs “ von „ rhs “ unterscheidet; andernfalls „ false “.
Siehe auch operator==().
[noexcept] bool operator==(const QCanvasBrush &lhs, const QCanvasBrush &rhs)
Gibt „ true “ zurück, wenn der Pinsel „ lhs “ mit „ rhs “ übereinstimmt; andernfalls „ false “.
Pinsel werden anhand ihres Werts verglichen, und der Vergleich zweier ` QCanvasBrush `-Objekte liefert dasselbe Ergebnis wie der Vergleich der konkreten Pinsel (z. B. ` QCanvasGridPattern`), aus denen sie erstellt wurden.
Siehe auch 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.