14 #include <qpainterpath.h>
17 QPointF p11, QPointF p12, QPointF p21, QPointF p22 )
19 const QLineF line1( p11, p12 );
20 const QLineF line2( p21, p22 );
23 #if QT_VERSION >= 0x050e00
24 if ( line1.intersects( line2, &pos ) == QLineF::NoIntersection )
26 if ( line1.intersect( line2, &pos ) == QLineF::NoIntersection )
79 int numThorns,
int numThornLevels )
85 const QColor dark( 128, 128, 255 );
86 const QColor light( 192, 255, 255 );
89 palette.setColor( QPalette::Dark, dark );
90 palette.setColor( QPalette::Light, light );
132 double radius,
double north, QPalette::ColorGroup cg )
const
135 pal.setCurrentColorGroup( cg );
156 const QPalette& palette,
157 const QPointF& center,
double radius,
double north,
double width,
158 int numThorns,
int numThornLevels,
double shrinkFactor )
177 painter->setPen( Qt::NoPen );
186 for (
int k = 0; k < 3; k++ )
192 double leafWidth = r *
width;
193 if ( 2.0 *
M_PI / step > 32 )
197 for (
double angle = origin;
198 angle < 2.0 *
M_PI + origin; angle += step )
203 const QPointF p3 =
qwtPolar2Pos( center, r, angle + step / 2.0 );
204 const QPointF p4 =
qwtPolar2Pos( center, r, angle - step / 2.0 );
206 QPainterPath darkPath;
207 darkPath.moveTo( center );
208 darkPath.lineTo( p );
211 painter->setBrush(
palette.brush( QPalette::Dark ) );
212 painter->drawPath( darkPath );
214 QPainterPath lightPath;
215 lightPath.moveTo( center );
216 lightPath.lineTo( p );
219 painter->setBrush(
palette.brush( QPalette::Light ) );
220 painter->drawPath( lightPath );