QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
| Public 类型 | Public 成员函数 | 所有成员列表
QwtIntervalSymbol类 参考

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

#include <qwt_interval_symbol.h>

class  PrivateData
 

Public 类型

enum  Style { NoSymbol = -1 , Bar , Box , UserSymbol = 1000 }
 Symbol style 更多...
 

Public 成员函数

 QwtIntervalSymbol (Style=NoSymbol)
 Constructor
 
 QwtIntervalSymbol (const QwtIntervalSymbol &)
 
QwtIntervalSymboloperator= (const QwtIntervalSymbol &)
 Assignment operator
 
bool operator== (const QwtIntervalSymbol &) const
 Compare two symbols
 
bool operator!= (const QwtIntervalSymbol &) const
 Compare two symbols
 
void setWidth (int)
 Specify the width of the symbol
 
int width () const
 Get the width 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 the current symbol style
 
virtual void draw (QPainter *, Qt::Orientation, const QPointF &from, const QPointF &to) const
 Draw a symbol depending on its style
 

详细描述

A drawing primitive for displaying an interval like an error bar

参见
QwtPlotIntervalCurve

成员枚举类型说明

◆ Style

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.

构造及析构函数说明

◆ QwtIntervalSymbol()

QwtIntervalSymbol::QwtIntervalSymbol ( Style  style = NoSymbol)
explicit

Constructor

参数
[in]styleStyle of the symbol
参见
setStyle(), style(), Style

Copy constructor

参数
[in]otherSymbol to copy

Destructor

成员函数说明

◆ brush()

const QBrush & QwtIntervalSymbol::brush ( ) const

Get the brush

返回
Brush
参见
setBrush()

◆ draw()

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

Draw a symbol depending on its style

参数
[in]painterPainter
[in]orientationOrientation
[in]fromStart point of the interval in target device coordinates
[in]toEnd point of the interval in target device coordinates
参见
setStyle()

◆ operator!=()

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

Compare two symbols

参数
[in]otherSymbol to compare
返回
True if symbols are not equal

◆ operator=()

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

Assignment operator

参数
[in]otherSymbol to assign
返回
Reference to this symbol

◆ operator==()

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

Compare two symbols

参数
[in]otherSymbol to compare
返回
True if symbols are equal

◆ pen()

const QPen & QwtIntervalSymbol::pen ( ) const

Get the pen

返回
Pen
参见
setPen(), brush()

◆ setBrush()

void QwtIntervalSymbol::setBrush ( const QBrush &  brush)

Assign a brush

The brush is used for the Box style.

参数
[in]brushBrush
参见
brush()

◆ 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.

参数
[in]colorPen color
[in]widthPen width
[in]stylePen style
参见
pen(), brush()

◆ setPen() [2/2]

void QwtIntervalSymbol::setPen ( const QPen &  pen)

Assign a pen

参数
[in]penPen
参见
pen(), setBrush()

◆ setStyle()

void QwtIntervalSymbol::setStyle ( Style  style)

Specify the symbol style

参数
[in]styleStyle
参见
style(), Style

◆ setWidth()

void QwtIntervalSymbol::setWidth ( int  width)

Specify the width of the symbol

It is used depending on the style.

参数
[in]widthWidth
参见
width(), setStyle()

◆ style()

QwtIntervalSymbol::Style QwtIntervalSymbol::style ( ) const

Get the current symbol style

返回
Current symbol style
参见
setStyle()

◆ width()

int QwtIntervalSymbol::width ( ) const

Get the width of the symbol

返回
Width of the symbol
参见
setWidth(), setStyle()

该类的文档由以下文件生成: