Qwt User's Guide: QwtIntervalSymbol Class Reference

Qwt User's Guide 6.3.0

Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
QwtIntervalSymbol Class Reference

A drawing primitive for displaying an interval like an error bar. More...

`#include <qwt_interval_symbol.h>`

## Public Types
enum | Style { NoSymbol = -1 , Bar , Box , UserSymbol = 1000 }
| Symbol style. More...

## Public Member Functions
| QwtIntervalSymbol (Style=NoSymbol)
| QwtIntervalSymbol (const QwtIntervalSymbol &)
| Copy constructor.
virtual | ~QwtIntervalSymbol ()
| Destructor.
QwtIntervalSymbol & | operator= (const QwtIntervalSymbol &)
| Assignment operator.
bool | operator== (const QwtIntervalSymbol &) const
| Compare two symbols.
bool | operator!= (const QwtIntervalSymbol &) const
| Compare two symbols.
void | setWidth (int)
int | width () const
void | setBrush (const QBrush &)
| Assign a brush.
const QBrush & | brush () const
void | setPen (const QColor &, qreal width=0.0, Qt::PenStyle=Qt::SolidLine)
void | setPen (const QPen &)
const QPen & | pen () const
void | setStyle (Style)
Style | style () const
virtual void | draw (QPainter *, Qt::Orientation, const QPointF &from, const QPointF &to) const

## Detailed Description

A drawing primitive for displaying an interval like an error bar.

See also
  QwtPlotIntervalCurve

Definition at line 27 of file qwt_interval_symbol.h.

## Member Enumeration Documentation

## ◆ Style

enum QwtIntervalSymbol::Style

Symbol style.

Enumerator
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 31 of file qwt_interval_symbol.h.

## Constructor & Destructor Documentation

## ◆ QwtIntervalSymbol() [1/2]

QwtIntervalSymbol::QwtIntervalSymbol | ( | Style | style = NoSymbol | ) |
| explicit

Constructor

Parameters

  style | Style of the symbol

See also
  setStyle(), style(), Style

Definition at line 47 of file qwt_interval_symbol.cpp.

## ◆ QwtIntervalSymbol() [2/2]

QwtIntervalSymbol::QwtIntervalSymbol | ( | const QwtIntervalSymbol & | other | ) |

Copy constructor.

Definition at line 54 of file qwt_interval_symbol.cpp.

## ◆ ~QwtIntervalSymbol()

QwtIntervalSymbol::~QwtIntervalSymbol | ( |  | ) |
| virtual

Destructor.

Definition at line 61 of file qwt_interval_symbol.cpp.

## Member Function Documentation

## ◆ brush()

const QBrush & QwtIntervalSymbol::brush | ( |  | ) | const

Returns
  Brush

See also
  setBrush()

Definition at line 146 of file qwt_interval_symbol.cpp.

## ◆ draw()

void QwtIntervalSymbol::draw | ( | QPainter * | painter,
|  | Qt::Orientation | orientation,
|  | const QPointF & | from,
|  | const QPointF & | to ) const
| virtual

Draw a symbol depending on its style

Parameters

  painter | Painter
  orientation | Orientation
  from | Start point of the interval in target device coordinates
  to | End point of the interval in target device coordinates

See also
  setStyle()

Definition at line 200 of file qwt_interval_symbol.cpp.

## ◆ operator!=()

bool QwtIntervalSymbol::operator!= | ( | const QwtIntervalSymbol & | other | ) | const

Compare two symbols.

Definition at line 82 of file qwt_interval_symbol.cpp.

## ◆ operator=()

QwtIntervalSymbol & QwtIntervalSymbol::operator= | ( | const QwtIntervalSymbol & | other | ) |

Assignment operator.

Definition at line 67 of file qwt_interval_symbol.cpp.

## ◆ operator==()

bool QwtIntervalSymbol::operator== | ( | const QwtIntervalSymbol & | other | ) | const

Compare two symbols.

Definition at line 75 of file qwt_interval_symbol.cpp.

## ◆ pen()

const QPen & QwtIntervalSymbol::pen | ( |  | ) | const

Returns
  Pen

See also
  setPen(), brush()

Definition at line 185 of file qwt_interval_symbol.cpp.

## ◆ setBrush()

void QwtIntervalSymbol::setBrush | ( | const QBrush & | brush | ) |

Assign a brush.

The brush is used for the Box style.

Parameters

  brush | Brush

See also
  brush()

Definition at line 137 of file qwt_interval_symbol.cpp.

## ◆ setPen() [1/2]

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.

Parameters

  color | Pen color
  width | Pen width
  style | Pen style

See also
  pen(), brush()

Definition at line 164 of file qwt_interval_symbol.cpp.

## ◆ setPen() [2/2]

void QwtIntervalSymbol::setPen | ( | const QPen & | pen | ) |

Assign a pen

Parameters

  pen | Pen

See also
  pen(), setBrush()

Definition at line 176 of file qwt_interval_symbol.cpp.

## ◆ setStyle()

void QwtIntervalSymbol::setStyle | ( | Style | style | ) |

Specify the symbol style

Parameters

  style | Style

See also
  style(), Style

Definition at line 94 of file qwt_interval_symbol.cpp.

## ◆ setWidth()

void QwtIntervalSymbol::setWidth | ( | int | width | ) |

Specify the width of the symbol It is used depending on the style.

Parameters

  width | Width

See also
  width(), setStyle()

Definition at line 115 of file qwt_interval_symbol.cpp.

## ◆ style()

QwtIntervalSymbol::Style QwtIntervalSymbol::style | ( |  | ) | const

Returns
  Current symbol style

See also
  setStyle()

Definition at line 103 of file qwt_interval_symbol.cpp.

## ◆ width()

int QwtIntervalSymbol::width | ( |  | ) | const

Returns
  Width of the symbol.

See also
  setWidth(), setStyle()

Definition at line 124 of file qwt_interval_symbol.cpp.