A drawing primitive for displaying an interval like an error bar. More...
#include <qwt_interval_symbol.h>
Classes | |
class | PrivateData |
Public Types | |
enum | Style { NoSymbol = -1, Bar, Box, UserSymbol = 1000 } |
Symbol style. More... | |
Public Member Functions | |
const QBrush & | brush () const |
virtual void | draw (QPainter *, Qt::Orientation, const QPointF &from, const QPointF &to) const |
bool | operator!= (const QwtIntervalSymbol &) const |
Compare two symbols. | |
QwtIntervalSymbol & | operator= (const QwtIntervalSymbol &) |
Assignment operator. | |
bool | operator== (const QwtIntervalSymbol &) const |
Compare two symbols. | |
const QPen & | pen () const |
QwtIntervalSymbol (Style=NoSymbol) | |
QwtIntervalSymbol (const QwtIntervalSymbol &) | |
Copy constructor. | |
void | setBrush (const QBrush &b) |
Assign a brush. | |
void | setPen (const QColor &, qreal width=0.0, Qt::PenStyle=Qt::SolidLine) |
void | setPen (const QPen &) |
void | setStyle (Style) |
void | setWidth (int) |
Style | style () const |
int | width () const |
virtual | ~QwtIntervalSymbol () |
Destructor. | |
Private Attributes | |
PrivateData * | d_data |
A drawing primitive for displaying an interval like an error bar.
Definition at line 26 of file qwt_interval_symbol.h.
Symbol style.
NoSymbol |
No Style. The symbol cannot be drawn. |
Bar |
The symbol displays a line with caps at the beginning/end. The size of the caps depends on the symbol width(). |
Box |
The symbol displays a plain rectangle using pen() and brush(). The size of the rectangle depends on the translated interval and the width(), |
UserSymbol |
Styles >= UserSymbol are reserved for derived classes of QwtIntervalSymbol that overload draw() with additional application specific symbol types. |
Definition at line 30 of file qwt_interval_symbol.h.
QwtIntervalSymbol::QwtIntervalSymbol | ( | Style | style = NoSymbol | ) | [explicit] |
Constructor
style | Style of the symbol |
Definition at line 51 of file qwt_interval_symbol.cpp.
QwtIntervalSymbol::QwtIntervalSymbol | ( | const QwtIntervalSymbol & | other | ) |
Copy constructor.
Definition at line 58 of file qwt_interval_symbol.cpp.
QwtIntervalSymbol::~QwtIntervalSymbol | ( | ) | [virtual] |
Destructor.
Definition at line 65 of file qwt_interval_symbol.cpp.
const QBrush & QwtIntervalSymbol::brush | ( | ) | const |
void QwtIntervalSymbol::draw | ( | QPainter * | painter, |
Qt::Orientation | orientation, | ||
const QPointF & | from, | ||
const QPointF & | to | ||
) | const [virtual] |
Draw a symbol depending on its style
painter | Painter |
orientation | Orientation |
from | Start point of the interval in target device coordinates |
to | End point of the interval in target device coordinates |
Definition at line 204 of file qwt_interval_symbol.cpp.
bool QwtIntervalSymbol::operator!= | ( | const QwtIntervalSymbol & | other | ) | const |
Compare two symbols.
Definition at line 86 of file qwt_interval_symbol.cpp.
QwtIntervalSymbol & QwtIntervalSymbol::operator= | ( | const QwtIntervalSymbol & | other | ) |
Assignment operator.
Definition at line 71 of file qwt_interval_symbol.cpp.
bool QwtIntervalSymbol::operator== | ( | const QwtIntervalSymbol & | other | ) | const |
Compare two symbols.
Definition at line 79 of file qwt_interval_symbol.cpp.
const QPen & QwtIntervalSymbol::pen | ( | ) | const |
void QwtIntervalSymbol::setBrush | ( | const QBrush & | brush | ) |
Assign a brush.
The brush is used for the Box style.
brush | Brush |
Definition at line 141 of file qwt_interval_symbol.cpp.
void QwtIntervalSymbol::setPen | ( | const QColor & | color, |
qreal | width = 0.0 , |
||
Qt::PenStyle | style = Qt::SolidLine |
||
) |
Build and assign a pen
In Qt5 the default pen width is 1.0 ( 0.0 in Qt4 ) what makes it non cosmetic ( see QPen::isCosmetic() ). This method has been introduced to hide this incompatibility.
color | Pen color |
width | Pen width |
style | Pen style |
Definition at line 168 of file qwt_interval_symbol.cpp.
void QwtIntervalSymbol::setPen | ( | const QPen & | pen | ) |
Assign a pen
pen | Pen |
Definition at line 180 of file qwt_interval_symbol.cpp.
void QwtIntervalSymbol::setStyle | ( | Style | style | ) |
Specify the symbol style
style | Style |
Definition at line 98 of file qwt_interval_symbol.cpp.
void QwtIntervalSymbol::setWidth | ( | int | width | ) |
Specify the width of the symbol It is used depending on the style.
width | Width |
Definition at line 119 of file qwt_interval_symbol.cpp.
Definition at line 107 of file qwt_interval_symbol.cpp.
int QwtIntervalSymbol::width | ( | ) | const |
Definition at line 128 of file qwt_interval_symbol.cpp.
PrivateData* QwtIntervalSymbol::d_data [private] |
Definition at line 82 of file qwt_interval_symbol.h.