Brush Style Editor¶
DABrushStyleComboBox is a Qt::BrushStyle selection combo box, and DABrushEditWidget combines color + style into a complete brush editor, supporting four modes: solid, pattern, gradient, and texture.
DABrushStyleComboBox¶

The dropdown uses swatch icons to preview every Qt::BrushStyle. Use setBrushColor() to tint the icons and setShowNoBrushStyle(false) to hide the NoBrush entry.
Key Features¶
- ✅ All fill styles: Solid and various patterns (
Qt::BDiagPattern, etc.) - ✅ Icon preview: Dropdown items include fill style icons
- ✅ NoBrush option: Can be hidden via
setShowNoBrushStyle(false)
Usage¶
1 2 3 4 5 6 7 | |
DABrushEditWidget¶

The brush editor combines a color button with a style dropdown to describe a QBrush, supporting solid, pattern, gradient, and texture fills; changes emit brushChanged.
Key Features¶
- ✅ Four modes: Solid / Pattern / Gradient / Texture
- ✅ Gradient types: Linear / Radial / Conical
- ✅ Texture loading: Set a texture brush from a QPixmap
Usage¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | |
Mode Detection
Use isColorBrush() on the style combo box to check whether the current selection is a solid color. The brush edit widget automatically adapts its UI based on the brush style — gradient brushes show gradient controls, texture brushes show a texture picker.
Core Properties & Methods¶
DABrushStyleComboBox¶
| Method | Description |
|---|---|
getCurrentBrushStyle() |
Get the current brush style |
setBrushColor(QColor) |
Set the icon color |
isColorBrush() |
Whether the current style is a solid color |
setShowNoBrushStyle(bool) |
Whether to show the NoBrush option |
setStyleTextVisible(bool) |
Style text visibility |
generateBrushStyleIcon(...) |
Generate a brush style icon (static) |
DABrushEditWidget¶
| Method | Description |
|---|---|
getCurrentBrush() |
Get the current brush |
setCurrentBrush(QBrush) |
Set the brush |
getCurrentBrushStyle() |
Get the brush style |
getCurrentBrushColor() |
Get the brush color |
setStyleTextVisible(bool) |
Style text visibility |