17 const QPalette &pal,
double lw )
21 if ( rect.width() == 0.0 )
23 p->setPen( pal.dark().color() );
24 p->drawLine( rect.topLeft(), rect.bottomLeft() );
28 if ( rect.height() == 0.0 )
30 p->setPen( pal.dark().color() );
31 p->drawLine( rect.topLeft(), rect.topRight() );
35 lw = qMin( lw, rect.height() / 2.0 - 1.0 );
36 lw = qMin( lw, rect.width() / 2.0 - 1.0 );
38 const QRectF outerRect = rect.adjusted( 0, 0, 1, 1 );
39 QPolygonF polygon( outerRect );
41 if ( outerRect.width() > 2 * lw &&
42 outerRect.height() > 2 * lw )
44 const QRectF innerRect = outerRect.adjusted( lw, lw, -lw, -lw );
45 polygon = polygon.subtracted( innerRect );
48 p->setPen( Qt::NoPen );
50 p->setBrush( pal.dark() );
51 p->drawPolygon( polygon );
54 const QRectF windowRect = rect.adjusted( lw, lw, -lw + 1, -lw + 1 );
55 if ( windowRect.isValid() )
56 p->fillRect( windowRect, pal.window() );
60 const QPalette &pal,
double lw )
64 if ( rect.width() == 0.0 )
66 painter->setPen( pal.window().color() );
67 painter->drawLine( rect.topLeft(), rect.bottomLeft() );
71 if ( rect.height() == 0.0 )
73 painter->setPen( pal.window().color() );
74 painter->drawLine( rect.topLeft(), rect.topRight() );
78 lw = qMin( lw, rect.height() / 2.0 - 1.0 );
79 lw = qMin( lw, rect.width() / 2.0 - 1.0 );
81 const QRectF outerRect = rect.adjusted( 0, 0, 1, 1 );
82 const QRectF innerRect = outerRect.adjusted( lw, lw, -lw, -lw );
86 lines[0] += outerRect.bottomLeft();
87 lines[0] += outerRect.topLeft();
88 lines[0] += outerRect.topRight();
89 lines[0] += innerRect.topRight();
90 lines[0] += innerRect.topLeft();
91 lines[0] += innerRect.bottomLeft();
93 lines[1] += outerRect.topRight();
94 lines[1] += outerRect.bottomRight();
95 lines[1] += outerRect.bottomLeft();
96 lines[1] += innerRect.bottomLeft();
97 lines[1] += innerRect.bottomRight();
98 lines[1] += innerRect.topRight();
100 painter->setPen( Qt::NoPen );
102 painter->setBrush( pal.light() );
103 painter->drawPolygon( lines[0] );
104 painter->setBrush( pal.dark() );
105 painter->drawPolygon( lines[1] );
108 painter->fillRect( rect.adjusted( lw, lw, -lw + 1, -lw + 1 ), pal.window() );
270 r.setLeft( qRound( r.left() ) );
271 r.setRight( qRound( r.right() ) );
272 r.setTop( qRound( r.top() ) );
273 r.setBottom( qRound( r.bottom() ) );
virtual ~QwtColumnSymbol()
Destructor.
A drawing primitive for columns.
static void qwtDrawBox(QPainter *p, const QRectF &rect, const QPalette &pal, double lw)
FrameStyle frameStyle() const
QwtColumnSymbol(Style=NoStyle)
static void qwtDrawPanel(QPainter *painter, const QRectF &rect, const QPalette &pal, double lw)
QwtColumnSymbol::FrameStyle frameStyle
QwtColumnSymbol::Style style
void setPalette(const QPalette &)
void setFrameStyle(FrameStyle style)
void setLineWidth(int width)
const QPalette & palette() const
Directed rectangle representing bounding rectangle and orientation of a column.
virtual void draw(QPainter *, const QwtColumnRect &) const
void drawBox(QPainter *, const QwtColumnRect &) const
static bool roundingAlignment()