Qwt Programmer's Manual
QwtSymbol
QwtSymbol - A class for drawing symbols
#include <qwt_symbol.h>
- QwtSymbol (1)
- Constructor
- QwtSymbol (2)
- Constructor
- ~QwtSymbol (3)
- Destructor
- draw (1)
- Draw the symbol
- draw (2)
- Draw the symbol
- draw (3)
- Draw the symbol
- setSize (1)
- Change the size
- setSize (2)
- Change the size
- setBrush
- Assign a brush
- setPen
- Assign a pen
- setStyle
- Change the style
- brush
- Return the brush
- pen
- Return the pen
- size
- Return the size
- style
- Return the style
Default Constructor
QwtSymbol::QwtSymbol()
The symbol is constructed with gray interior,
black outline with zero width, no size and style 'None'.
Constructor
QwtSymbol::QwtSymbol(QwtSymbol::Style st, const QBrush &bd, const QPen &pn, const QSize &s)
- QwtSymbol::Style st
- Symbol Style
- QBrush &bd
- brush to fill the interior
- QPen &pn
- outline pen
- QSize &size
- size
Destructor
QwtSymbol::~QwtSymbol()
Specify the symbol's size
void QwtSymbol::setSize(int w, int h)
- int w
- width
- int h = -1
- height
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).
Set the symbol's size
void QwtSymbol::setSize(const QSize &s)
- const QSize &s
- new size
Assign a brush
void QwtSymbol::setBrush(const QBrush &br)
- const QBrush &br
- brush
The brush is used to draw the interior of the symbol.
Assign a pen
void QwtSymbol::setPen(const QPen &pn)
- const QPen &pn
- pen
The pen is used to draw the symbol's outline.
Draw the symbol at a point (x,y).
void QwtSymbol::draw(QPainter *p, int x, int y)
- QPainter *p, int x, int y
-
The point (x,y) is the upper left corner of a rectangle with
the symbol's size.
Draw the symbol into a bounding rectangle.
void QwtSymbol::draw(QPainter *p, const QRect& r)
- QPainter *p
- Painter
- const QRect& r
- Bounding rectangle
This function overrides the symbol's size settings,
but it doesn't modify them.
Draw the symbol at a specified point
void QwtSymbol::draw(QPainter *p, const QPoint &p)
- QPainter *p
- painter
- const QPoint &pt
- point
The point specifies the upper left corner of a
rectangle with the symbol's size.
Specify the symbol style
QwtSymbol::Style QwtSymbol::setStyle(QwtSymbol::Style s)
- QwtSymbol::Style s
- style
The following styles are defined:
- QwtSymbol::None
- No Style. The symbol cannot be drawn.
- QwtSymbol::Ellipse
- Ellipse or circle
- QwtSymbol::Rect
- Rectangle
- QwtSymbol::Diamond
- Diamond
- QwtSymbol::Triangle
- Triangle pointing upwards
- QwtSymbol::DTriangle
- Triangle pointing downwards
- QwtSymbol::UTriangle
- Triangle pointing upwards
- QwtSymbol::LTriangle
- Triangle pointing left
- QwtSymbol::RTriangle
- Triangle pointing right
- QwtSymbol::Cross
- Cross
- QwtSymbol::XCross
- Diagonal cross
Qwt Widget Library 27/04/96