31 QList<QPair<Qt::BrushStyle, QString>> styles;
32 styles << qMakePair( Qt::SolidPattern, tr(
"Solid" ) )
33 << qMakePair( Qt::NoBrush, tr(
"No Brush" ) )
34 << qMakePair( Qt::HorPattern, tr(
"Horizontal" ) )
35 << qMakePair( Qt::VerPattern, tr(
"Vertical" ) )
36 << qMakePair( Qt::CrossPattern, tr(
"Cross" ) )
37 << qMakePair( Qt::BDiagPattern, tr(
"BDiagonal" ) )
38 << qMakePair( Qt::FDiagPattern, tr(
"FDiagonal" ) )
39 << qMakePair( Qt::DiagCrossPattern, tr(
"Diagonal X" ) )
40 << qMakePair( Qt::Dense1Pattern, tr(
"Dense 1" ) )
41 << qMakePair( Qt::Dense2Pattern, tr(
"Dense 2" ) )
42 << qMakePair( Qt::Dense3Pattern, tr(
"Dense 3" ) )
43 << qMakePair( Qt::Dense4Pattern, tr(
"Dense 4" ) )
44 << qMakePair( Qt::Dense5Pattern, tr(
"Dense 5" ) )
45 << qMakePair( Qt::Dense6Pattern, tr(
"Dense 6" ) )
46 << qMakePair( Qt::Dense7Pattern, tr(
"Dense 7" ) );
49 setIconSize( QSize( iconSize * 2, iconSize ) );
51 for (
int i = 0; i < styles.count(); i++ )
53 const Qt::BrushStyle style = styles.at( i ).first;
54 const QString name = styles.at( i ).second;
55 addItem(
iconForBrush( style ), name, QVariant(
static_cast<int>( style ) ) );
75 QPixmap pix( iconSize() );
77 pix.fill( Qt::transparent );
80 const QBrush brush( view()->palette().color( QPalette::Text ), style );
82 const QPen pen( Qt::NoPen );
84 p.drawRect( QRect( QPoint( 0, 0 ), iconSize() ) );