30 QList < QPair<Qt::PenStyle, QString> > styles;
31 styles << qMakePair( Qt::SolidLine, tr(
"Solid Line" ) )
32 << qMakePair( Qt::NoPen, tr(
"No Pen" ) )
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" ) );
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 ) );
51 return ( Qt::PenStyle ) currentData().toInt();
56 const int idx = findData( QVariant( (
int ) style ) );
57 setCurrentIndex( idx == -1 ? 0 : idx );
64 pix.fill( Qt::transparent );
70 const double mid =
iconSize().height() / 2.0;
71 p.drawLine( 0, mid,
iconSize().width(), mid );
85 addItem( QIcon( path +
"/join_bevel.svg" ), tr(
"Bevel" ), QVariant( Qt::BevelJoin ) );
86 addItem( QIcon( path +
"/join_miter.svg" ), tr(
"Miter" ), QVariant( Qt::MiterJoin ) );
87 addItem( QIcon( path +
"/join_round.svg" ), tr(
"Round" ), QVariant( Qt::RoundJoin ) );
92 return ( Qt::PenJoinStyle ) currentData().toInt();
97 const int idx = findData( QVariant( style ) );
98 setCurrentIndex( idx == -1 ? 0 : idx );
106 : QComboBox( parent )
109 addItem( QIcon( path +
"/cap_square.svg" ), tr(
"Square" ), QVariant( Qt::SquareCap ) );
110 addItem( QIcon( path +
"/cap_flat.svg" ), tr(
"Flat" ), QVariant( Qt::FlatCap ) );
111 addItem( QIcon( path +
"/cap_round.svg" ), tr(
"Round" ), QVariant( Qt::RoundCap ) );
116 return ( Qt::PenCapStyle ) currentData().toInt();
121 const int idx = findData( QVariant( style ) );
122 setCurrentIndex( idx == -1 ? 0 : idx );