18 const QPalette &pal,
double lw )
22 if ( rect.width() == 0.0 )
24 p->setPen( pal.dark().color() );
25 p->drawLine( rect.topLeft(), rect.bottomLeft() );
29 if ( rect.height() == 0.0 )
31 p->setPen( pal.dark().color() );
32 p->drawLine( rect.topLeft(), rect.topRight() );
36 lw =
qwtMinF( lw, rect.height() / 2.0 - 1.0 );
37 lw =
qwtMinF( lw, rect.width() / 2.0 - 1.0 );
39 const QRectF outerRect = rect.adjusted( 0, 0, 1, 1 );
40 QPolygonF polygon( outerRect );
42 if ( outerRect.width() > 2 * lw &&
43 outerRect.height() > 2 * lw )
45 const QRectF innerRect = outerRect.adjusted( lw, lw, -lw, -lw );
46 polygon = polygon.subtracted( innerRect );
49 p->setPen( Qt::NoPen );
51 p->setBrush( pal.dark() );
52 p->drawPolygon( polygon );
55 const QRectF windowRect = rect.adjusted( lw, lw, -lw + 1, -lw + 1 );
56 if ( windowRect.isValid() )
57 p->fillRect( windowRect, pal.window() );
61 const QPalette &pal,
double lw )
65 if ( rect.width() == 0.0 )
67 painter->setPen( pal.window().color() );
68 painter->drawLine( rect.topLeft(), rect.bottomLeft() );
72 if ( rect.height() == 0.0 )
74 painter->setPen( pal.window().color() );
75 painter->drawLine( rect.topLeft(), rect.topRight() );
79 lw =
qwtMinF( lw, rect.height() / 2.0 - 1.0 );
80 lw =
qwtMinF( lw, rect.width() / 2.0 - 1.0 );
82 const QRectF outerRect = rect.adjusted( 0, 0, 1, 1 );
83 const QRectF innerRect = outerRect.adjusted( lw, lw, -lw, -lw );
87 lines[0] += outerRect.bottomLeft();
88 lines[0] += outerRect.topLeft();
89 lines[0] += outerRect.topRight();
90 lines[0] += innerRect.topRight();
91 lines[0] += innerRect.topLeft();
92 lines[0] += innerRect.bottomLeft();
94 lines[1] += outerRect.topRight();
95 lines[1] += outerRect.bottomRight();
96 lines[1] += outerRect.bottomLeft();
97 lines[1] += innerRect.bottomLeft();
98 lines[1] += innerRect.bottomRight();
99 lines[1] += innerRect.topRight();
101 painter->setPen( Qt::NoPen );
103 painter->setBrush( pal.light() );
104 painter->drawPolygon( lines[0] );
105 painter->setBrush( pal.dark() );
106 painter->drawPolygon( lines[1] );
109 painter->fillRect( rect.adjusted( lw, lw, -lw + 1, -lw + 1 ), pal.window() );
271 r.setLeft( qRound( r.left() ) );
272 r.setRight( qRound( r.right() ) );
273 r.setTop( qRound( r.top() ) );
274 r.setBottom( qRound( r.bottom() ) );
291 painter->fillRect( r.adjusted( 0, 0, 1, 1 ),
d_data->
palette.window() );
299 QRectF r( hInterval.minValue(), vInterval.minValue(),
300 hInterval.maxValue() - hInterval.minValue(),
301 vInterval.maxValue() - vInterval.minValue() );
306 r.adjust( 1, 0, 0, 0 );
309 r.adjust( 0, 0, -1, 0 );
312 r.adjust( 0, 1, 0, 0 );
315 r.adjust( 0, 0, 0, -1 );
virtual ~QwtColumnSymbol()
Destructor.
Max value is not included in the interval.
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
QWT_CONSTEXPR float qwtMinF(float a, float b)
QwtColumnSymbol::Style style
void setPalette(const QPalette &)
Min value is not included in the interval.
void setFrameStyle(FrameStyle)
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()