30 QList < QPair<Qt::PenStyle, QString> > styles;
31 styles << qMakePair( Qt::SolidLine, tr(
"Solid Line" ) )
32 << qMakePair( Qt::NoPen, tr(
"No Line" ) )
33 << qMakePair( Qt::DashLine, tr(
"Dash Line" ) )
34 << qMakePair( Qt::DotLine, tr(
"Dot Line" ) )
35 << qMakePair( Qt::DashDotLine, tr(
"Dash Dot Line" ) )
36 << qMakePair( Qt::DashDotDotLine, tr(
"Dash Dot Dot Line" ) );
39 setIconSize( QSize( iconSize * 2, iconSize ) );
41 for (
int i = 0; i < styles.count(); i++ )
43 const Qt::PenStyle style = styles.at( i ).first;
44 const QString name = styles.at( i ).second;
45 addItem(
iconForPen( style ), name, QVariant( (
int ) style ) );
62 QPixmap pix( iconSize() );
64 pix.fill( Qt::transparent );
70 const double mid = iconSize().height() / 2.0;
71 p.drawLine( 0, mid, iconSize().width(), mid );