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