135 const QRectF &canvasRect )
const 155 const QRectF &canvasRect,
const QPointF &pos )
const 171 y, canvasRect.right() - 1.0, y );
181 canvasRect.top(), x, canvasRect.bottom() - 1.0 );
195 const QRectF &canvasRect,
const QPointF &pos )
const 204 const QSizeF sz = symbol.
size();
206 const QRectF clipRect = canvasRect.adjusted(
207 -sz.width(), -sz.height(), sz.width(), sz.height() );
209 if ( clipRect.contains( pos ) )
224 const QRectF &canvasRect,
const QPointF &pos )
const 230 QPointF alignPos = pos;
232 QSizeF symbolOff( 0, 0 );
243 alignPos.setY( canvasRect.top() );
244 align &= ~
Qt::AlignTop;
245 align |= Qt::AlignBottom;
252 alignPos.setY( canvasRect.bottom() - 1 );
253 align &= ~
Qt::AlignBottom;
254 align |= Qt::AlignTop;
258 alignPos.setY( canvasRect.center().y() );
266 alignPos.setX( canvasRect.left() );
267 align &= ~
Qt::AlignLeft;
268 align |= Qt::AlignRight;
272 alignPos.setX( canvasRect.right() - 1 );
273 align &= ~
Qt::AlignRight;
274 align |= Qt::AlignLeft;
278 alignPos.setX( canvasRect.center().x() );
299 const qreal xOff = qMax( pw2, symbolOff.width() );
300 const qreal yOff = qMax( pw2, symbolOff.height() );
304 if ( align & Qt::AlignLeft )
306 alignPos.rx() -= xOff +
spacing;
308 alignPos.rx() -= textSize.height();
310 alignPos.rx() -= textSize.width();
312 else if ( align & Qt::AlignRight )
314 alignPos.rx() += xOff +
spacing;
319 alignPos.rx() -= textSize.height() / 2;
321 alignPos.rx() -= textSize.width() / 2;
324 if ( align & Qt::AlignTop )
326 alignPos.ry() -= yOff +
spacing;
328 alignPos.ry() -= textSize.height();
330 else if ( align & Qt::AlignBottom )
332 alignPos.ry() += yOff +
spacing;
334 alignPos.ry() += textSize.width();
339 alignPos.ry() += textSize.width() / 2;
341 alignPos.ry() -= textSize.height() / 2;
344 painter->translate( alignPos.x(), alignPos.y() );
346 painter->rotate( -90.0 );
348 const QRectF textRect( 0, 0, textSize.width(), textSize.height() );
578 const QSizeF &size )
const 582 if ( size.isEmpty() )
589 QPainter painter( &icon );
590 painter.setRenderHint( QPainter::Antialiasing,
600 const double y = 0.5 * size.height();
603 0.0, y, size.width(), y );
609 const double x = 0.5 * size.width();
612 x, 0.0, x, size.height() );
618 const QRect r( 0.0, 0.0, size.width(), size.height() );
Qt::Alignment labelAlignment() const
virtual void legendChanged()
virtual QRect boundingRect() const
LineStyle lineStyle() const
static void drawLine(QPainter *, double x1, double y1, double x2, double y2)
Wrapper for QPainter::drawLine()
virtual void draw(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &) const
void setValue(double, double)
Set Value.
virtual void drawLines(QPainter *, const QRectF &, const QPointF &) const
void setSymbol(const QwtSymbol *)
Assign a symbol.
void draw(QPainter *painter, const QRectF &rect) const
Qt::Orientation labelOrientation
A class for drawing symbols.
TFSIMD_FORCE_INLINE const tfScalar & y() const
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)
CONSTEXPR_F fields align(second_tag, fields f) noexcept
double yValue() const
Return y Value.
QSizeF textSize(const QFont &=QFont()) const
const QSize & size() const
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.
virtual QRectF boundingRect() const
void setZ(double z)
Set the z value.
A paint device for scalable graphics.
virtual QwtGraphic legendIcon(int index, const QSizeF &) const
TFSIMD_FORCE_INLINE const tfScalar & x() const
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.
void setLineStyle(LineStyle st)
Set the line style.
Base class for items on the plot canvas.
void setLegendIconSize(const QSize &)
double transform(double s) const
QwtPlotMarker(const QString &title=QString())
Sets alignment to Qt::AlignCenter, and style to QwtPlotMarker::NoLine.
void drawSymbol(QPainter *, const QRectF &) const
Draw the symbol into a rectangle.
static bool roundingAlignment()
Qt::Alignment labelAlignment
const QPen & linePen() const
A class for drawing markers.
const QwtText & title() const
No Style. The symbol cannot be drawn.