144 const QRectF &canvasRect )
const 164 const QRectF &canvasRect,
const QPointF &pos )
const 180 y, canvasRect.right() - 1.0, y );
190 canvasRect.top(), x, canvasRect.bottom() - 1.0 );
204 const QRectF &canvasRect,
const QPointF &pos )
const 213 const QSizeF sz = symbol.
size();
215 const QRectF clipRect = canvasRect.adjusted(
216 -sz.width(), -sz.height(), sz.width(), sz.height() );
218 if ( clipRect.contains( pos ) )
233 const QRectF &canvasRect,
const QPointF &pos )
const 239 QPointF alignPos = pos;
241 QSizeF symbolOff( 0, 0 );
252 alignPos.setY( canvasRect.top() );
253 align &= ~Qt::AlignTop;
254 align |= Qt::AlignBottom;
261 alignPos.setY( canvasRect.bottom() - 1 );
262 align &= ~Qt::AlignBottom;
263 align |= Qt::AlignTop;
267 alignPos.setY( canvasRect.center().y() );
275 alignPos.setX( canvasRect.left() );
276 align &= ~Qt::AlignLeft;
277 align |= Qt::AlignRight;
281 alignPos.setX( canvasRect.right() - 1 );
282 align &= ~Qt::AlignRight;
283 align |= Qt::AlignLeft;
287 alignPos.setX( canvasRect.center().x() );
308 const qreal xOff =
qwtMaxF( pw2, symbolOff.width() );
309 const qreal yOff =
qwtMaxF( pw2, symbolOff.height() );
313 if ( align & Qt::AlignLeft )
315 alignPos.rx() -= xOff +
spacing;
317 alignPos.rx() -= textSize.height();
319 alignPos.rx() -= textSize.width();
321 else if ( align & Qt::AlignRight )
323 alignPos.rx() += xOff +
spacing;
328 alignPos.rx() -= textSize.height() / 2;
330 alignPos.rx() -= textSize.width() / 2;
333 if ( align & Qt::AlignTop )
335 alignPos.ry() -= yOff +
spacing;
337 alignPos.ry() -= textSize.height();
339 else if ( align & Qt::AlignBottom )
341 alignPos.ry() += yOff +
spacing;
343 alignPos.ry() += textSize.width();
348 alignPos.ry() += textSize.width() / 2;
350 alignPos.ry() -= textSize.height() / 2;
353 painter->translate( alignPos.x(), alignPos.y() );
355 painter->rotate( -90.0 );
357 const QRectF textRect( 0, 0, textSize.width(), textSize.height() );
602 if ( size.isEmpty() )
609 QPainter painter( &icon );
610 painter.setRenderHint( QPainter::Antialiasing,
620 const double y = 0.5 * size.height();
623 0.0, y, size.width(), y );
629 const double x = 0.5 * size.width();
632 x, 0.0, x, size.height() );
638 const QRect r( 0.0, 0.0, size.width(), size.height() );
Qt::Alignment labelAlignment() const
void setLineStyle(LineStyle)
Set the line style.
virtual void legendChanged()
virtual QRect boundingRect() const
LineStyle lineStyle() const
void setValue(double, double)
Set Value.
static void drawLine(QPainter *, qreal x1, qreal y1, qreal x2, qreal y2)
Wrapper for QPainter::drawLine()
QWT_CONSTEXPR float qwtMaxF(float a, float b)
virtual void drawLines(QPainter *, const QRectF &, const QPointF &) const
void setSymbol(const QwtSymbol *)
Assign a symbol.
virtual QwtGraphic legendIcon(int index, const QSizeF &) const QWT_OVERRIDE
void draw(QPainter *painter, const QRectF &rect) const
Qt::Orientation labelOrientation
A class for drawing symbols.
virtual int rtti() const QWT_OVERRIDE
void setRenderHint(RenderHint, bool on=true)
void setDefaultSize(const QSizeF &)
Set a default size.
void setLinePen(const QColor &, qreal width=0.0, Qt::PenStyle=Qt::SolidLine)
double yValue() const
Return y Value.
const QSize & size() const
virtual QRectF boundingRect() const QWT_OVERRIDE
void * align(std::size_t alignment, std::size_t size, void *&ptr, std::size_t &space, std::size_t &required_space)
bool testRenderHint(RenderHint) const
double xValue() const
Return x Value.
void setSpacing(int)
Set the spacing.
const QwtSymbol * symbol() const
void setXValue(double)
Set X Value.
A class representing a text.
void setZ(double z)
Set the z value.
A paint device for scalable graphics.
QwtPlotMarker()
Sets alignment to Qt::AlignCenter, and style to QwtPlotMarker::NoLine.
virtual void itemChanged()
virtual void drawSymbol(QPainter *, const QRectF &, const QPointF &) const
void setLabel(const QwtText &)
Set the label.
virtual void drawLabel(QPainter *, const QRectF &, const QPointF &) const
Qt::Orientation labelOrientation() const
QPointF value() const
Return Value.
virtual ~QwtPlotMarker()
Destructor.
void setLabelAlignment(Qt::Alignment)
Set the alignment of the label.
void setYValue(double)
Set Y Value.
void setLabelOrientation(Qt::Orientation)
Set the orientation of the label.
Base class for items on the plot canvas.
void setLegendIconSize(const QSize &)
double transform(double s) const
void drawSymbol(QPainter *, const QRectF &) const
Draw the symbol into a rectangle.
static bool roundingAlignment()
Qt::Alignment labelAlignment
virtual void draw(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &) const QWT_OVERRIDE
const QPen & linePen() const
A class for drawing markers.
const QwtText & title() const
No Style. The symbol cannot be drawn.