30 QList < QPair<Qt::BrushStyle, QString> > styles;
31 styles << qMakePair( Qt::SolidPattern, tr(
"Solid" ) )
32 << qMakePair( Qt::NoBrush, tr(
"No Brush" ) )
33 << qMakePair( Qt::HorPattern, tr(
"Horizontal" ) )
34 << qMakePair( Qt::VerPattern, tr(
"Vertical" ) )
35 << qMakePair( Qt::CrossPattern, tr(
"Cross" ) )
36 << qMakePair( Qt::BDiagPattern, tr(
"BDiagonal" ) )
37 << qMakePair( Qt::FDiagPattern, tr(
"FDiagonal" ) )
38 << qMakePair( Qt::DiagCrossPattern, tr(
"Diagonal X" ) )
39 << qMakePair( Qt::Dense1Pattern, tr(
"Dense 1" ) )
40 << qMakePair( Qt::Dense2Pattern, tr(
"Dense 2" ) )
41 << qMakePair( Qt::Dense3Pattern, tr(
"Dense 3" ) )
42 << qMakePair( Qt::Dense4Pattern, tr(
"Dense 4" ) )
43 << qMakePair( Qt::Dense5Pattern, tr(
"Dense 5" ) )
44 << qMakePair( Qt::Dense6Pattern, tr(
"Dense 6" ) )
45 << qMakePair( Qt::Dense7Pattern, tr(
"Dense 7" ) );
48 setIconSize( QSize( iconSize * 2, iconSize ) );
50 for (
int i = 0; i < styles.count(); i++ )
52 const Qt::BrushStyle style = styles.at( i ).first;
53 const QString name = styles.at( i ).second;
54 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() ) );