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
QwtSymbol Class Reference

A class for drawing symbols . More...

#include <qwt_symbol.h>

Classes

class  PrivateData
 

Public Types

enum  Style {
  NoSymbol = -1 , Ellipse , Rect , Diamond ,
  Triangle , DTriangle , UTriangle , LTriangle ,
  RTriangle , Cross , XCross , HLine ,
  VLine , Star1 , Star2 , Hexagon ,
  Path , Pixmap , Graphic , SvgDocument ,
  UserStyle = 1000
}
 Symbol Style. More...
 
enum  CachePolicy { NoCache , Cache , AutoCache }
 Cache policy for symbol rendering. More...
 

Public Member Functions

 QwtSymbol (Style=NoSymbol)
 Default Constructor.
 
 QwtSymbol (Style, const QBrush &, const QPen &, const QSize &)
 Constructor.
 
 QwtSymbol (const QPainterPath &, const QBrush &, const QPen &)
 Constructor.
 
virtual ~QwtSymbol ()
 Destructor .
 
void setCachePolicy (CachePolicy)
 Change the cache policy.
 
CachePolicy cachePolicy () const
 Get the cache policy.
 
void setSize (const QSize &)
 Set the symbol's size.
 
void setSize (int width, int height=-1)
 Specify the symbol's size.
 
const QSize & size () const
 Get the symbol's size.
 
void setPinPoint (const QPointF &pos, bool enable=true)
 Set and enable a pin point.
 
QPointF pinPoint () const
 Get pin point.
 
void setPinPointEnabled (bool)
 Enable/disable the pin point alignment.
 
bool isPinPointEnabled () const
 Check if pin point is enabled.
 
virtual void setColor (const QColor &)
 Set the color of the symbol.
 
void setBrush (const QBrush &)
 Assign a brush.
 
const QBrush & brush () const
 Get the brush.
 
void setPen (const QColor &, qreal width=0.0, Qt::PenStyle=Qt::SolidLine)
 Build and assign a pen.
 
void setPen (const QPen &)
 Assign a pen.
 
const QPen & pen () const
 Get the pen.
 
void setStyle (Style)
 Specify the symbol style.
 
Style style () const
 Get current symbol style.
 
void setPath (const QPainterPath &)
 Set a painter path as symbol.
 
const QPainterPath & path () const
 Get painter path for displaying the symbol.
 
void setPixmap (const QPixmap &)
 Set a pixmap as symbol.
 
const QPixmap & pixmap () const
 Get assigned pixmap.
 
void setGraphic (const QwtGraphic &)
 Set a graphic as symbol.
 
const QwtGraphicgraphic () const
 Get assigned graphic.
 
void setSvgDocument (const QByteArray &)
 Set a SVG icon as symbol.
 
void drawSymbol (QPainter *, const QRectF &) const
 Draw the symbol into a rectangle.
 
void drawSymbol (QPainter *, const QPointF &) const
 Draw the symbol at a specified position.
 
void drawSymbols (QPainter *, const QPolygonF &) const
 Draw symbols at the specified points.
 
void drawSymbols (QPainter *, const QPointF *, int numPoints) const
 Render an array of symbols.
 
virtual QRect boundingRect () const
 Calculate the bounding rectangle for a symbol at position (0,0)
 
void invalidateCache ()
 Invalidate the cached symbol pixmap.
 

Protected Member Functions

virtual void renderSymbols (QPainter *, const QPointF *, int numPoints) const
 Render the symbol to series of points.
 

Detailed Description

A class for drawing symbols .

Member Enumeration Documentation

◆ CachePolicy

Cache policy for symbol rendering.

Enumerator
NoCache 

Don't use a pixmap cache

Cache 

Always use a pixmap cache

AutoCache 

Use a cache when one of the following conditions is true:

  • The symbol is rendered with the software renderer ( QPaintEngine::Raster )

◆ Style

Symbol Style.

Enumerator
NoSymbol 

No Style. The symbol cannot be drawn.

Ellipse 

Ellipse or circle

Rect 

Rectangle

Diamond 

Diamond

Triangle 

Triangle pointing upwards

DTriangle 

Triangle pointing downwards

UTriangle 

Triangle pointing upwards

LTriangle 

Triangle pointing left

RTriangle 

Triangle pointing right

Cross 

Cross (+)

XCross 

Diagonal cross (X)

HLine 

Horizontal line

VLine 

Vertical line

Star1 

X combined with +

Star2 

Six-pointed star

Hexagon 

Hexagon

Path 

The symbol is represented by a painter path, where the origin ( 0, 0 ) of the path coordinate system is mapped to the position of the symbol.

See also
setPath(), path()
Pixmap 

The symbol is represented by a pixmap. The pixmap is centered or aligned to its pin point.

See also
setPinPoint()
Graphic 

The symbol is represented by a graphic. The graphic is centered or aligned to its pin point.

See also
setPinPoint()
SvgDocument 

The symbol is represented by a SVG graphic. The graphic is centered or aligned to its pin point.

See also
setPinPoint()
UserStyle 

Styles >= QwtSymbol::UserSymbol are reserved for derived classes of QwtSymbol that overload drawSymbols() with additional application specific symbol types.

Constructor & Destructor Documentation

◆ QwtSymbol() [1/3]

QwtSymbol::QwtSymbol ( Style  style = NoSymbol)
explicit

Default Constructor.

◆ QwtSymbol() [2/3]

QwtSymbol::QwtSymbol ( QwtSymbol::Style  style,
const QBrush &  brush,
const QPen &  pen,
const QSize &  size 
)

Constructor.

◆ QwtSymbol() [3/3]

QwtSymbol::QwtSymbol ( const QPainterPath &  path,
const QBrush &  brush,
const QPen &  pen 
)

Constructor.

◆ ~QwtSymbol()

QwtSymbol::~QwtSymbol ( )
virtual

Destructor .

Member Function Documentation

◆ boundingRect()

QRect QwtSymbol::boundingRect ( ) const
virtual

Calculate the bounding rectangle for a symbol at position (0,0)

◆ brush()

const QBrush & QwtSymbol::brush ( ) const

Get the brush.

◆ cachePolicy()

QwtSymbol::CachePolicy QwtSymbol::cachePolicy ( ) const

Get the cache policy.

◆ drawSymbol() [1/2]

void QwtSymbol::drawSymbol ( QPainter *  painter,
const QPointF &  pos 
) const
inline

Draw the symbol at a specified position.

◆ drawSymbol() [2/2]

void QwtSymbol::drawSymbol ( QPainter *  painter,
const QRectF &  rect 
) const

Draw the symbol into a rectangle.

◆ drawSymbols() [1/2]

void QwtSymbol::drawSymbols ( QPainter *  painter,
const QPointF *  points,
int  numPoints 
) const

Render an array of symbols.

◆ drawSymbols() [2/2]

void QwtSymbol::drawSymbols ( QPainter *  painter,
const QPolygonF &  points 
) const
inline

Draw symbols at the specified points.

◆ graphic()

const QwtGraphic & QwtSymbol::graphic ( ) const

Get assigned graphic.

◆ invalidateCache()

void QwtSymbol::invalidateCache ( )

Invalidate the cached symbol pixmap.

◆ isPinPointEnabled()

bool QwtSymbol::isPinPointEnabled ( ) const

Check if pin point is enabled.

◆ path()

const QPainterPath & QwtSymbol::path ( ) const

Get painter path for displaying the symbol.

◆ pen()

const QPen & QwtSymbol::pen ( ) const

Get the pen.

◆ pinPoint()

QPointF QwtSymbol::pinPoint ( ) const

Get pin point.

◆ pixmap()

const QPixmap & QwtSymbol::pixmap ( ) const

Get assigned pixmap.

◆ renderSymbols()

void QwtSymbol::renderSymbols ( QPainter *  painter,
const QPointF *  points,
int  numPoints 
) const
protectedvirtual

Render the symbol to series of points.

Parameters
painterQt painter
pointsPositions of the symbols
numPointsNumber of points

◆ setBrush()

void QwtSymbol::setBrush ( const QBrush &  brush)

Assign a brush.

◆ setCachePolicy()

void QwtSymbol::setCachePolicy ( QwtSymbol::CachePolicy  policy)

Change the cache policy.

◆ setColor()

void QwtSymbol::setColor ( const QColor &  color)
virtual

Set the color of the symbol.

◆ setGraphic()

void QwtSymbol::setGraphic ( const QwtGraphic graphic)

Set a graphic as symbol.

◆ setPath()

void QwtSymbol::setPath ( const QPainterPath &  path)

Set a painter path as symbol.

◆ setPen() [1/2]

void QwtSymbol::setPen ( const QColor &  color,
qreal  width = 0.0,
Qt::PenStyle  style = Qt::SolidLine 
)

Build and assign a pen.

◆ setPen() [2/2]

void QwtSymbol::setPen ( const QPen &  pen)

Assign a pen.

◆ setPinPoint()

void QwtSymbol::setPinPoint ( const QPointF &  pos,
bool  enable = true 
)

Set and enable a pin point.

◆ setPinPointEnabled()

void QwtSymbol::setPinPointEnabled ( bool  on)

Enable/disable the pin point alignment.

◆ setPixmap()

void QwtSymbol::setPixmap ( const QPixmap &  pixmap)

Set a pixmap as symbol.

◆ setSize() [1/2]

void QwtSymbol::setSize ( const QSize &  size)

Set the symbol's size.

◆ setSize() [2/2]

void QwtSymbol::setSize ( int  width,
int  height = -1 
)

Specify the symbol's size.

◆ setStyle()

void QwtSymbol::setStyle ( QwtSymbol::Style  style)

Specify the symbol style.

◆ setSvgDocument()

void QwtSymbol::setSvgDocument ( const QByteArray &  svgDocument)

Set a SVG icon as symbol.

◆ size()

const QSize & QwtSymbol::size ( ) const

Get the symbol's size.

◆ style()

QwtSymbol::Style QwtSymbol::style ( ) const

Get current symbol style.


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