31 QList < QPair<Qt::PenStyle, QString> > styles;
32 styles << qMakePair( Qt::SolidLine, tr(
"Solid Line" ) )
33 << qMakePair( Qt::NoPen, tr(
"No Line" ) )
34 << qMakePair( Qt::DashLine, tr(
"Dash Line" ) )
35 << qMakePair( Qt::DotLine, tr(
"Dot Line" ) )
36 << qMakePair( Qt::DashDotLine, tr(
"Dash Dot Line" ) )
37 << qMakePair( Qt::DashDotDotLine, tr(
"Dash Dot Dot Line" ) );
40 setIconSize( QSize( iconSize * 2, iconSize ) );
42 for (
int i = 0; i < styles.count(); i++ )
44 const Qt::PenStyle style = styles.at( i ).first;
45 const QString name = styles.at( i ).second;
46 addItem(
iconForPen( style ), name, QVariant( (
int ) style ) );
63 QPixmap pix( iconSize() );
65 pix.fill( Qt::transparent );
70 pen.setColor( view()->palette().color( QPalette::Text ) );
73 const double mid = iconSize().height() / 2.0;
74 p.drawLine( 0, mid, iconSize().width(), mid );