29 QList < QPair<Qt::BrushStyle, QString> > styles;
30 styles << qMakePair( Qt::SolidPattern, tr(
"Solid" ) )
31 << qMakePair( Qt::NoBrush, tr(
"No Brush" ) )
32 << qMakePair( Qt::HorPattern, tr(
"Horizontal" ) )
33 << qMakePair( Qt::VerPattern, tr(
"Vertical" ) )
34 << qMakePair( Qt::CrossPattern, tr(
"Cross" ) )
35 << qMakePair( Qt::BDiagPattern, tr(
"BDiagonal" ) )
36 << qMakePair( Qt::FDiagPattern, tr(
"FDiagonal" ) )
37 << qMakePair( Qt::DiagCrossPattern, tr(
"Diagonal X" ) )
38 << qMakePair( Qt::Dense1Pattern, tr(
"Dense 1" ) )
39 << qMakePair( Qt::Dense2Pattern, tr(
"Dense 2" ) )
40 << qMakePair( Qt::Dense3Pattern, tr(
"Dense 3" ) )
41 << qMakePair( Qt::Dense4Pattern, tr(
"Dense 4" ) )
42 << qMakePair( Qt::Dense5Pattern, tr(
"Dense 5" ) )
43 << qMakePair( Qt::Dense6Pattern, tr(
"Dense 6" ) )
44 << qMakePair( Qt::Dense7Pattern, tr(
"Dense 7" ) );
47 setIconSize( QSize( iconSize * 2, iconSize ) );
49 for (
int i = 0; i < styles.count(); i++ )
51 const Qt::BrushStyle style = styles.at( i ).first;
52 const QString name = styles.at( i ).second;
53 addItem(
iconForBrush( style ), name, QVariant(
static_cast<int>( style ) ) );
74 QPixmap pix( iconSize() );
76 pix.fill( Qt::transparent );
79 const QBrush brush( QColor( 100, 100, 100 ), style );
81 const QPen pen( Qt::NoPen );
83 p.drawRect( QRect( QPoint( 0, 0 ), iconSize() ) );