Go to the documentation of this file.
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
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() );
const QSize & size() const
const QwtSymbol * symbol() const
double yValue() const
Return y Value.
virtual void legendChanged()
A paint device for scalable graphics.
@ HLine
A horizontal line.
void setRenderHint(RenderHint, bool on=true)
virtual QRect boundingRect() const
virtual int rtti() const QWT_OVERRIDE
virtual void drawSymbol(QPainter *, const QRectF &, const QPointF &) const
const QPen & linePen() const
static bool roundingAlignment()
QPointF value() const
Return Value.
void setSymbol(const QwtSymbol *)
Assign a symbol.
@ NoSymbol
No Style. The symbol cannot be drawn.
void setXValue(double)
Set X Value.
virtual QwtGraphic legendIcon(int index, const QSizeF &) const QWT_OVERRIDE
span_constexpr std::size_t size(span< T, Extent > const &spn)
Qt::Alignment labelAlignment
A class representing a text.
A class for drawing symbols.
Qt::Orientation labelOrientation() const
QWT_CONSTEXPR float qwtMaxF(float a, float b)
LineStyle lineStyle() const
void drawSymbol(QPainter *, const QRectF &) const
Draw the symbol into a rectangle.
void setZ(double z)
Set the z value.
static void drawLine(QPainter *, qreal x1, qreal y1, qreal x2, qreal y2)
Wrapper for QPainter::drawLine()
void setLinePen(const QColor &, qreal width=0.0, Qt::PenStyle=Qt::SolidLine)
Base class for items on the plot canvas.
void setSpacing(int)
Set the spacing.
virtual QRectF boundingRect() const QWT_OVERRIDE
double transform(double s) const
virtual void itemChanged()
virtual ~QwtPlotMarker()
Destructor.
void setLabel(const QwtText &)
Set the label.
QwtPlotMarker()
Sets alignment to Qt::AlignCenter, and style to QwtPlotMarker::NoLine.
constexpr std::uintptr_t align(std::size_t alignment, std::uintptr_t ptr, std::size_t &space)
double xValue() const
Return x Value.
void setYValue(double)
Set Y Value.
@ Rtti_PlotMarker
For QwtPlotMarker.
void setLabelOrientation(Qt::Orientation)
Set the orientation of the label.
Qt::Orientation labelOrientation
virtual void draw(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &) const QWT_OVERRIDE
void draw(QPainter *painter, const QRectF &rect) const
virtual void drawLabel(QPainter *, const QRectF &, const QPointF &) const
bool testRenderHint(RenderHint) const
virtual void drawLines(QPainter *, const QRectF &, const QPointF &) const
void setLabelAlignment(Qt::Alignment)
Set the alignment of the label.
void setLegendIconSize(const QSize &)
@ RenderAntialiased
Enable antialiasing.
void setDefaultSize(const QSizeF &)
Set a default size.
Qt::Alignment labelAlignment() const
void setLineStyle(LineStyle)
Set the line style.
void setValue(double, double)
Set Value.
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:46