QWT API (English) 7.0.1
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
QwtPlotArrowMarker Class Reference

A class for drawing arrow markers on plots. More...

#include <qwt_plot_arrowmarker.h>

Inheritance diagram for QwtPlotArrowMarker:
QwtPlotItem

Classes

class  PrivateData
 

Public Types

enum  EndpointStyle {
  NoEndpoint = 0 , ArrowHead , Circle , Square ,
  Diamond , Triangle , CustomPath
}
 Arrow endpoint style types. More...
 
enum  PositionMode { ExplicitPoints , StartLengthAngle }
 Arrow positioning mode. More...
 
- Public Types inherited from QwtPlotItem
enum  RttiValues {
  Rtti_PlotItem = 0 , Rtti_PlotGrid , Rtti_PlotScale , Rtti_PlotLegend ,
  Rtti_PlotMarker , Rtti_PlotCurve , Rtti_PlotSpectroCurve , Rtti_PlotIntervalCurve ,
  Rtti_PlotHistogram , Rtti_PlotSpectrogram , Rtti_PlotGraphic , Rtti_PlotTradingCurve ,
  Rtti_PlotBarChart , Rtti_PlotMultiBarChart , Rtti_PlotShape , Rtti_PlotTextLabel ,
  Rtti_PlotZone , Rtti_PlotVectorField , Rtti_PlotArrowMarker , Rtti_PlotBoxChart ,
  Rtti_PlotUserItem = 1000
}
 Runtime type information. More...
 
enum  ItemAttribute { Legend = 0x01 , AutoScale = 0x02 , Margins = 0x04 }
 Plot Item Attributes. More...
 
enum  ItemInterest { ScaleInterest = 0x01 , LegendInterest = 0x02 }
 Plot Item Interests. More...
 
enum  RenderHint { RenderAntialiased = 0x1 }
 Render hints . More...
 

Public Member Functions

 QwtPlotArrowMarker ()
 Default constructor.
 
 QwtPlotArrowMarker (const QString &title)
 Constructor with title.
 
 QwtPlotArrowMarker (const QwtText &title)
 Constructor with QwtText title.
 
virtual ~QwtPlotArrowMarker ()
 Destructor .
 
virtual int rtti () const override
 Get the runtime type information.
 
QPointF startPoint () const
 Get the start point of the arrow.
 
QPointF endPoint () const
 Get the end point of the arrow.
 
void setStartPoint (const QPointF &point)
 Set the start point in plot coordinates.
 
void setEndPoint (const QPointF &point)
 Set the end point in plot coordinates.
 
void setPoints (const QPointF &start, const QPointF &end)
 Set both start and end points in plot coordinates.
 
double length () const
 Get the arrow length in pixels.
 
void setLength (double length)
 Set the arrow length in pixels.
 
double angle () const
 Get the rotation angle in degrees.
 
void setAngle (double angle)
 Set the rotation angle in degrees.
 
PositionMode positionMode () const
 Get the positioning mode.
 
void setPositionMode (PositionMode mode)
 Set the positioning mode.
 
const QPen & linePen () const
 Get the arrow line pen.
 
void setLinePen (const QPen &pen)
 Set the arrow line pen.
 
void setLinePen (const QColor &color, qreal width=1.0, Qt::PenStyle style=Qt::SolidLine)
 Convenience method to set line color and width.
 
EndpointStyle headStyle () const
 Get the head style.
 
void setHeadStyle (EndpointStyle style)
 Set the head style.
 
EndpointStyle tailStyle () const
 Get the tail style.
 
void setTailStyle (EndpointStyle style)
 Set the tail style.
 
QSizeF headSize () const
 Get the head size in pixels.
 
void setHeadSize (const QSizeF &size)
 Set the head size in pixels.
 
void setHeadSize (qreal size)
 Convenience method to set head size with equal width and height.
 
QSizeF tailSize () const
 Get the tail size in pixels.
 
void setTailSize (const QSizeF &size)
 Set the tail size in pixels.
 
void setTailSize (qreal size)
 Convenience method to set tail size with equal width and height.
 
const QBrush & headBrush () const
 Get the head brush.
 
void setHeadBrush (const QBrush &brush)
 Set the head brush.
 
const QBrush & tailBrush () const
 Get the tail brush.
 
void setTailBrush (const QBrush &brush)
 Set the tail brush.
 
const QPen & headPen () const
 Get the head pen.
 
void setHeadPen (const QPen &pen)
 Set the head pen.
 
const QPen & tailPen () const
 Get the tail pen.
 
void setTailPen (const QPen &pen)
 Set the tail pen.
 
void setHeadCustomPath (const QPainterPath &path)
 Set a custom path for head endpoint.
 
QPainterPath headCustomPath () const
 Get the custom head path.
 
void setTailCustomPath (const QPainterPath &path)
 Set a custom path for tail endpoint.
 
QPainterPath tailCustomPath () const
 Get the custom tail path.
 
virtual void draw (QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const override
 Draw the arrow marker on the plot.
 
virtual QRectF boundingRect () const override
 Get the bounding rectangle.
 
virtual QwtGraphic legendIcon (int index, const QSizeF &size) const override
 Get the legend icon.
 
- Public Member Functions inherited from QwtPlotItem
 QwtPlotItem ()
 Default constructor.
 
 QwtPlotItem (const QString &title)
 Constructor with title as QString.
 
 QwtPlotItem (const QwtText &title)
 Constructor with title as QwtText.
 
virtual ~QwtPlotItem ()
 Destructor.
 
void attach (QwtPlot *plot)
 Attach the item to a plot.
 
void detach ()
 Detach the item from the plot.
 
QwtPlotplot () const
 Get the plot the item is attached to.
 
void setTitle (const QString &title)
 Set the title using a QString.
 
void setTitle (const QwtText &title)
 Set the title using a QwtText.
 
const QwtTexttitle () const
 Get the title.
 
void setItemAttribute (ItemAttribute, bool on=true)
 Set an item attribute.
 
bool testItemAttribute (ItemAttribute) const
 Test an item attribute.
 
void setItemInterest (ItemInterest, bool on=true)
 Set an item interest.
 
bool testItemInterest (ItemInterest) const
 Test an item interest.
 
void setRenderHint (RenderHint, bool on=true)
 Set a render hint.
 
bool testRenderHint (RenderHint) const
 Test a render hint.
 
void setRenderThreadCount (uint numThreads)
 Set the number of render threads.
 
uint renderThreadCount () const
 Get the number of render threads.
 
void setLegendIconSize (const QSize &)
 Set the legend icon size.
 
QSize legendIconSize () const
 Get the legend icon size.
 
double z () const
 Get the z-value.
 
void setZ (double z)
 Set the z-value.
 
void show ()
 Show the item.
 
void hide ()
 Hide the item.
 
virtual void setVisible (bool)
 Set the visibility.
 
bool isVisible () const
 Check if the item is visible.
 
void setAxes (QwtAxisId xAxis, QwtAxisId yAxis)
 Set both axes.
 
void setXAxis (QwtAxisId)
 Set the x-axis.
 
QwtAxisId xAxis () const
 Get the x-axis.
 
void setYAxis (QwtAxisId)
 Set the y-axis.
 
QwtAxisId yAxis () const
 Get the y-axis.
 
virtual void itemChanged ()
 Notify the plot that the item has changed.
 
virtual void legendChanged ()
 Notify the item that the legend has changed.
 
virtual void getCanvasMarginHint (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, double &left, double &top, double &right, double &bottom) const
 Get margin hints for the canvas.
 
virtual void updateScaleDiv (const QwtScaleDiv &, const QwtScaleDiv &)
 Update the item with new scale divisions.
 
virtual void updateLegend (const QwtPlotItem *, const QList< QwtLegendData > &)
 Update the item with changes of the legend.
 
QRectF scaleRect (const QwtScaleMap &, const QwtScaleMap &) const
 Calculate the scale rectangle.
 
QRectF paintRect (const QwtScaleMap &, const QwtScaleMap &) const
 Calculate the paint rectangle.
 
virtual QList< QwtLegendDatalegendData () const
 Return legend data.
 

Protected Member Functions

virtual void drawArrowLine (QPainter *painter, const QPointF &canvasStart, const QPointF &canvasEnd) const
 Draw the arrow line.
 
virtual void drawCachedEndpoint (QPainter *painter, const QPointF &position, const QPainterPath &cachedPath, const QSizeF &size, const QPen &pen, const QBrush &brush, double rotation=0.0) const
 Draw a cached endpoint path.
 
virtual QPointF toCanvasPoint (const QPointF &plotPoint, const QwtScaleMap &xMap, const QwtScaleMap &yMap) const
 Convert plot coordinates to canvas coordinates.
 
virtual QPointF calculateEndPoint () const
 Calculate end point based on start point, length, and angle.
 
- Protected Member Functions inherited from QwtPlotItem
QwtGraphic defaultIcon (const QBrush &, const QSizeF &) const
 Create a default icon.
 

Detailed Description

A class for drawing arrow markers on plots.

Member Enumeration Documentation

◆ EndpointStyle

Arrow endpoint style types.

Enumerator
NoEndpoint 

No endpoint (invisible)

.

ArrowHead 

Arrow head style

.

Circle 

Circle endpoint

.

Square 

Square endpoint

.

Diamond 

Diamond endpoint

.

Triangle 

Triangle endpoint

.

CustomPath 

Custom QPainterPath endpoint

.

◆ PositionMode

Arrow positioning mode.

Enumerator
ExplicitPoints 

Use explicit start and end points.

StartLengthAngle 

start point, length, and angle

Constructor & Destructor Documentation

◆ QwtPlotArrowMarker() [1/3]

QwtPlotArrowMarker::QwtPlotArrowMarker ( )
explicit

Default constructor.

◆ QwtPlotArrowMarker() [2/3]

QwtPlotArrowMarker::QwtPlotArrowMarker ( const QString &  title)
explicit

Constructor with title.

◆ QwtPlotArrowMarker() [3/3]

QwtPlotArrowMarker::QwtPlotArrowMarker ( const QwtText title)
explicit

Constructor with QwtText title.

◆ ~QwtPlotArrowMarker()

QwtPlotArrowMarker::~QwtPlotArrowMarker ( )
virtual

Destructor .

Member Function Documentation

◆ angle()

double QwtPlotArrowMarker::angle ( ) const

Get the rotation angle in degrees.

◆ boundingRect()

QRectF QwtPlotArrowMarker::boundingRect ( ) const
overridevirtual

Get the bounding rectangle.

Reimplemented from QwtPlotItem.

◆ draw()

void QwtPlotArrowMarker::draw ( QPainter *  painter,
const QwtScaleMap xMap,
const QwtScaleMap yMap,
const QRectF &  canvasRect 
) const
overridevirtual

Draw the arrow marker on the plot.

Implements QwtPlotItem.

◆ drawCachedEndpoint()

void QwtPlotArrowMarker::drawCachedEndpoint ( QPainter *  painter,
const QPointF &  position,
const QPainterPath &  cachedPath,
const QSizeF &  size,
const QPen &  pen,
const QBrush &  brush,
double  rotation = 0.0 
) const
protectedvirtual

Draw a cached endpoint path.

◆ endPoint()

QPointF QwtPlotArrowMarker::endPoint ( ) const

Get the end point of the arrow.

◆ headBrush()

const QBrush & QwtPlotArrowMarker::headBrush ( ) const

Get the head brush.

◆ headCustomPath()

QPainterPath QwtPlotArrowMarker::headCustomPath ( ) const

Get the custom head path.

◆ headPen()

const QPen & QwtPlotArrowMarker::headPen ( ) const

Get the head pen.

◆ headSize()

QSizeF QwtPlotArrowMarker::headSize ( ) const

Get the head size in pixels.

◆ headStyle()

QwtPlotArrowMarker::EndpointStyle QwtPlotArrowMarker::headStyle ( ) const

Get the head style.

◆ legendIcon()

QwtGraphic QwtPlotArrowMarker::legendIcon ( int  index,
const QSizeF &  size 
) const
overridevirtual

Get the legend icon.

Reimplemented from QwtPlotItem.

◆ length()

double QwtPlotArrowMarker::length ( ) const

Get the arrow length in pixels.

◆ linePen()

const QPen & QwtPlotArrowMarker::linePen ( ) const

Get the arrow line pen.

◆ positionMode()

QwtPlotArrowMarker::PositionMode QwtPlotArrowMarker::positionMode ( ) const

Get the positioning mode.

◆ rtti()

int QwtPlotArrowMarker::rtti ( ) const
overridevirtual

Get the runtime type information.

Reimplemented from QwtPlotItem.

◆ setAngle()

void QwtPlotArrowMarker::setAngle ( double  angle)

Set the rotation angle in degrees.

◆ setEndPoint()

void QwtPlotArrowMarker::setEndPoint ( const QPointF &  point)

Set the end point in plot coordinates.

◆ setHeadBrush()

void QwtPlotArrowMarker::setHeadBrush ( const QBrush &  brush)

Set the head brush.

◆ setHeadCustomPath()

void QwtPlotArrowMarker::setHeadCustomPath ( const QPainterPath &  path)

Set a custom path for head endpoint.

◆ setHeadPen()

void QwtPlotArrowMarker::setHeadPen ( const QPen &  pen)

Set the head pen.

◆ setHeadSize() [1/2]

void QwtPlotArrowMarker::setHeadSize ( const QSizeF &  size)

Set the head size in pixels.

◆ setHeadSize() [2/2]

void QwtPlotArrowMarker::setHeadSize ( qreal  size)

Convenience method to set head size with equal width and height.

◆ setHeadStyle()

void QwtPlotArrowMarker::setHeadStyle ( EndpointStyle  style)

Set the head style.

◆ setLength()

void QwtPlotArrowMarker::setLength ( double  length)

Set the arrow length in pixels.

◆ setLinePen() [1/2]

void QwtPlotArrowMarker::setLinePen ( const QColor &  color,
qreal  width = 1.0,
Qt::PenStyle  style = Qt::SolidLine 
)

Convenience method to set line color and width.

◆ setLinePen() [2/2]

void QwtPlotArrowMarker::setLinePen ( const QPen &  pen)

Set the arrow line pen.

◆ setPoints()

void QwtPlotArrowMarker::setPoints ( const QPointF &  start,
const QPointF &  end 
)

Set both start and end points in plot coordinates.

◆ setPositionMode()

void QwtPlotArrowMarker::setPositionMode ( PositionMode  mode)

Set the positioning mode.

◆ setStartPoint()

void QwtPlotArrowMarker::setStartPoint ( const QPointF &  point)

Set the start point in plot coordinates.

◆ setTailBrush()

void QwtPlotArrowMarker::setTailBrush ( const QBrush &  brush)

Set the tail brush.

◆ setTailCustomPath()

void QwtPlotArrowMarker::setTailCustomPath ( const QPainterPath &  path)

Set a custom path for tail endpoint.

◆ setTailPen()

void QwtPlotArrowMarker::setTailPen ( const QPen &  pen)

Set the tail pen.

◆ setTailSize() [1/2]

void QwtPlotArrowMarker::setTailSize ( const QSizeF &  size)

Set the tail size in pixels.

◆ setTailSize() [2/2]

void QwtPlotArrowMarker::setTailSize ( qreal  size)

Convenience method to set tail size with equal width and height.

◆ setTailStyle()

void QwtPlotArrowMarker::setTailStyle ( EndpointStyle  style)

Set the tail style.

◆ startPoint()

QPointF QwtPlotArrowMarker::startPoint ( ) const

Get the start point of the arrow.

◆ tailBrush()

const QBrush & QwtPlotArrowMarker::tailBrush ( ) const

Get the tail brush.

◆ tailCustomPath()

QPainterPath QwtPlotArrowMarker::tailCustomPath ( ) const

Get the custom tail path.

◆ tailPen()

const QPen & QwtPlotArrowMarker::tailPen ( ) const

Get the tail pen.

◆ tailSize()

QSizeF QwtPlotArrowMarker::tailSize ( ) const

Get the tail size in pixels.

◆ tailStyle()

QwtPlotArrowMarker::EndpointStyle QwtPlotArrowMarker::tailStyle ( ) const

Get the tail style.


The documentation for this class was generated from the following files: