A class for drawing symbols. More...
#include <qwt_symbol.h>
Public Types | |
enum | Style { NoSymbol = -1, Ellipse, Rect, Diamond, Triangle, DTriangle, UTriangle, LTriangle, RTriangle, Cross, XCross, HLine, VLine, Star1, Star2, Hexagon, StyleCnt } |
Public Member Functions | |
QwtSymbol () | |
QwtSymbol (Style, const QBrush &, const QPen &, const QSizeF &) | |
virtual | ~QwtSymbol () |
bool | operator!= (const QwtSymbol &) const |
virtual bool | operator== (const QwtSymbol &) const |
virtual QwtSymbol * | clone () const |
void | setSize (const QSizeF &) |
void | setSize (double width, double height=-1.0) |
const QSizeF & | size () const |
virtual void | setColor (const QColor &) |
void | setBrush (const QBrush &b) |
const QBrush & | brush () const |
void | setPen (const QPen &) |
const QPen & | pen () const |
void | setStyle (Style) |
Style | style () const |
void | draw (QPainter *p, const QPointF &) const |
void | draw (QPainter *p, double x, double y) const |
virtual void | draw (QPainter *p, const QRectF &r) const |
A class for drawing symbols.
enum QwtSymbol::Style |
Style
QwtSymbol::QwtSymbol | ( | ) |
Default Constructor
The symbol is constructed with gray interior, black outline with zero width, no size and style 'NoSymbol'.
QwtSymbol::QwtSymbol | ( | QwtSymbol::Style | style, | |
const QBrush & | brush, | |||
const QPen & | pen, | |||
const QSizeF & | size | |||
) |
Constructor.
style | Symbol Style | |
brush | brush to fill the interior | |
pen | outline pen | |
size | size |
QwtSymbol::~QwtSymbol | ( | ) | [virtual] |
Destructor.
const QBrush & QwtSymbol::brush | ( | ) | const [inline] |
Return Brush.
QwtSymbol * QwtSymbol::clone | ( | ) | const [virtual] |
Allocate and return a symbol with the same attributes
void QwtSymbol::draw | ( | QPainter * | painter, | |
const QRectF & | r | |||
) | const [virtual] |
Draw the symbol into a bounding rectangle.
This function assumes that the painter has been initialized with brush and pen before. This allows a much more performant implementation when painting many symbols with the same brush and pen like in curves.
painter | Painter | |
r | Bounding rectangle |
void QwtSymbol::draw | ( | QPainter * | p, | |
double | x, | |||
double | y | |||
) | const |
Draw the symbol at a point (x,y).
void QwtSymbol::draw | ( | QPainter * | painter, | |
const QPointF & | pos | |||
) | const |
Draw the symbol at a specified point.
painter | Painter | |
pos | Center of the symbol |
bool QwtSymbol::operator!= | ( | const QwtSymbol & | other | ) | const |
!= operator
bool QwtSymbol::operator== | ( | const QwtSymbol & | other | ) | const [virtual] |
== operator
const QPen & QwtSymbol::pen | ( | ) | const [inline] |
Return Pen.
void QwtSymbol::setBrush | ( | const QBrush & | brush | ) |
Assign a brush.
The brush is used to draw the interior of the symbol.
brush | Brush |
void QwtSymbol::setColor | ( | const QColor & | color | ) | [virtual] |
Set the color of the symbol.
Change the color of the brush for symbol types with a filled area. For all other symbol types the color will be assigned to the pen.
color | Color |
void QwtSymbol::setPen | ( | const QPen & | pen | ) |
Assign a pen
The pen is used to draw the symbol's outline.
The width of non cosmetic pens is scaled according to the resolution of the paint device.
pen | Pen |
void QwtSymbol::setSize | ( | double | width, | |
double | height = -1.0 | |||
) |
Specify the symbol's size.
If the 'h' parameter is left out or less than 0, and the 'w' parameter is greater than or equal to 0, the symbol size will be set to (w,w).
width | Width | |
height | Height (defaults to -1.0) |
void QwtSymbol::setSize | ( | const QSizeF & | size | ) |
Set the symbol's size
size | Size |
void QwtSymbol::setStyle | ( | QwtSymbol::Style | s | ) |
Specify the symbol style.
The following styles are defined:
s | style |
const QSizeF & QwtSymbol::size | ( | ) | const [inline] |
Return Size.
QwtSymbol::Style QwtSymbol::style | ( | ) | const [inline] |
Return Style.