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

QwtPlotHistogram 表示一系列样本,其中每个区间都与一个值相关联 ( $y = f([x1,x2])$ ) 更多...

#include <qwt_plot_histogram.h>

类 QwtPlotHistogram 继承关系图:
QwtPlotSeriesItem QwtSeriesStore< QwtIntervalSample > QwtPlotItem QwtAbstractSeriesStore QwtAbstractSeriesStore

class  PrivateData
 

Public 类型

enum  HistogramStyle { Outline , Columns , Lines , UserStyle = 100 }
 直方图样式 更多...
 
- Public 类型 继承自 QwtPlotItem
enum  RttiValues {
  Rtti_PlotItem = 0 , Rtti_PlotGrid , Rtti_PlotScale , Rtti_PlotLegend ,
  Rtti_PlotMarker , Rtti_PlotCurve , Rtti_PlotSpectroCurve , Rtti_PlotIntervalCurve ,
  Rtti_PlotHistogram , Rtti_PlotSpectrogram , Rtti_PlotGraphic , Rtti_PlotTradingCurve ,
  Rtti_PlotBarChart , Rtti_PlotMultiBarChart , Rtti_PlotShape , Rtti_PlotTextLabel ,
  Rtti_PlotZone , Rtti_PlotVectorField , Rtti_PlotArrowMarker , Rtti_PlotBoxChart ,
  Rtti_PlotUserItem = 1000
}
 运行时类型信息 更多...
 
enum  ItemAttribute { Legend = 0x01 , AutoScale = 0x02 , Margins = 0x04 }
 绘图项属性 更多...
 
enum  ItemInterest { ScaleInterest = 0x01 , LegendInterest = 0x02 }
 绘图项关注的事件类型 更多...
 
enum  RenderHint { RenderAntialiased = 0x1 }
 渲染提示 更多...
 

Public 成员函数

 QwtPlotHistogram (const QString &title=QString())
 QString标题的构造函数
 
 QwtPlotHistogram (const QwtText &title)
 QwtText标题的构造函数
 
virtual ~QwtPlotHistogram ()
 析构函数
 
virtual int rtti () const override
 获取运行时类型信息
 
void setPen (const QColor &, qreal width=0.0, Qt::PenStyle=Qt::SolidLine)
 构建并分配画笔
 
void setPen (const QPen &)
 分配画笔,根据 style() 的不同而使用
 
const QPen & pen () const
 获取根据 style() 不同使用的画笔
 
void setBrush (const QBrush &)
 分配画刷,根据 style() 的不同而使用
 
const QBrush & brush () const
 获取根据 style() 不同使用的画刷
 
void setSamples (const QVector< QwtIntervalSample > &)
 用样本数组初始化数据
 
void setSamples (QwtSeriesData< QwtIntervalSample > *)
 分配样本序列
 
void setBaseline (double)
 设置基线的值
 
double baseline () const
 获取基线的值
 
void setStyle (HistogramStyle style)
 设置直方图的绘制样式
 
HistogramStyle style () const
 获取直方图的绘制样式
 
void setSymbol (const QwtColumnSymbol *)
 分配符号
 
const QwtColumnSymbolsymbol () const
 获取当前符号
 
virtual void drawSeries (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const override
 绘制直方图样本的子集
 
virtual QRectF boundingRect () const override
 获取所有样本的边界矩形
 
virtual QwtGraphic legendIcon (int index, const QSizeF &) const override
 A plain rectangle without pen using the brush()
 
- Public 成员函数 继承自 QwtPlotSeriesItem
 QwtPlotSeriesItem (const QString &title=QString())
 构造函数
 
 QwtPlotSeriesItem (const QwtText &title)
 构造函数
 
virtual ~QwtPlotSeriesItem ()
 析构函数
 
void setOrientation (Qt::Orientation)
 设置绘图项的方向
 
Qt::Orientation orientation () const
 获取绘图项的方向
 
virtual void draw (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const override
 绘制完整系列
 
virtual void updateScaleDiv (const QwtScaleDiv &, const QwtScaleDiv &) override
 更新刻度划分
 
- Public 成员函数 继承自 QwtPlotItem
 QwtPlotItem ()
 Default constructor
 
 QwtPlotItem (const QString &title)
 Constructor with title as QString
 
 QwtPlotItem (const QwtText &title)
 Constructor with title as QwtText
 
virtual ~QwtPlotItem ()
 Destructor
 
void attach (QwtPlot *plot)
 Attach the item to a plot
 
void detach ()
 Detach the item from the plot
 
QwtPlotplot () const
 Get the plot the item is attached to
 
void setTitle (const QString &title)
 Set the title using a QString
 
void setTitle (const QwtText &title)
 Set the title using a QwtText
 
const QwtTexttitle () const
 Get the title
 
void setItemAttribute (ItemAttribute, bool on=true)
 Set an item attribute
 
bool testItemAttribute (ItemAttribute) const
 Test an item attribute
 
void setItemInterest (ItemInterest, bool on=true)
 Set an item interest
 
bool testItemInterest (ItemInterest) const
 Test an item interest
 
void setRenderHint (RenderHint, bool on=true)
 Set a render hint
 
bool testRenderHint (RenderHint) const
 Test a render hint
 
void setRenderThreadCount (uint numThreads)
 Set the number of render threads
 
uint renderThreadCount () const
 Get the number of render threads
 
void setLegendIconSize (const QSize &)
 Set the legend icon size
 
QSize legendIconSize () const
 Get the legend icon size
 
double z () const
 Get the z-value
 
void setZ (double z)
 Set the z-value
 
void show ()
 Show the item
 
void hide ()
 Hide the item
 
virtual void setVisible (bool)
 Set the visibility
 
bool isVisible () const
 Check if the item is visible
 
void setAxes (QwtAxisId xAxis, QwtAxisId yAxis)
 Set both axes
 
void setXAxis (QwtAxisId)
 Set the x-axis
 
QwtAxisId xAxis () const
 Get the x-axis
 
void setYAxis (QwtAxisId)
 Set the y-axis
 
QwtAxisId yAxis () const
 Get the y-axis
 
virtual void itemChanged ()
 Notify the plot that the item has changed
 
virtual void legendChanged ()
 Notify the item that the legend has changed
 
virtual void getCanvasMarginHint (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, double &left, double &top, double &right, double &bottom) const
 Get margin hints for the canvas
 
virtual void updateLegend (const QwtPlotItem *, const QList< QwtLegendData > &)
 Update the item with changes of the legend
 
QRectF scaleRect (const QwtScaleMap &, const QwtScaleMap &) const
 Calculate the scale rectangle
 
QRectF paintRect (const QwtScaleMap &, const QwtScaleMap &) const
 Calculate the paint rectangle
 
virtual QList< QwtLegendDatalegendData () const
 Return legend data
 
- Public 成员函数 继承自 QwtSeriesStore< QwtIntervalSample >
void setData (QwtSeriesData< QwtIntervalSample > *series)
 
QwtSeriesData< QwtIntervalSample > * data ()
 
const QwtSeriesData< QwtIntervalSample > * data () const
 
QwtIntervalSample sample (size_t index) const
 
virtual size_t dataSize () const override
 
virtual QRectF dataRect () const override
 
virtual void setRectOfInterest (const QRectF &rect) override
 Set a the "rectangle of interest" for the stored series
 
QwtSeriesData< QwtIntervalSample > * swapData (QwtSeriesData< QwtIntervalSample > *series)
 

Protected 成员函数

virtual QwtColumnRect columnRect (const QwtIntervalSample &, const QwtScaleMap &, const QwtScaleMap &) const
 Calculate the area that is covered by a sample
 
virtual void drawColumn (QPainter *, const QwtColumnRect &, const QwtIntervalSample &) const
 Draw a column for a sample in Columns style().
 
void drawColumns (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, int from, int to) const
 Draw a histogram in Columns style()
 
void drawOutline (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, int from, int to) const
 Draw a histogram in Outline style()
 
void drawLines (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, int from, int to) const
 Draw a histogram in Lines style()
 
- Protected 成员函数 继承自 QwtPlotSeriesItem
virtual void dataChanged () override
 dataChanged() indicates, that the series has been changed.
 
- Protected 成员函数 继承自 QwtPlotItem
QwtGraphic defaultIcon (const QBrush &, const QSizeF &) const
 Create a default icon
 

详细描述

QwtPlotHistogram 表示一系列样本,其中每个区间都与一个值相关联 ( $y = f([x1,x2])$ )

成员枚举类型说明

◆ HistogramStyle

直方图样式

枚举值
Outline 

使用 pen() 在所有区间构建的区域周围绘制轮廓,并用 brush() 填充它。 轮廓样式要求区间按递增顺序排列且不重叠。

Columns 

为每个区间绘制一个列。当设置了 symbol() 时,使用该符号; 否则,使用 pen()brush() 将列显示为普通矩形。

Lines 

使用 pen() 为每个区间绘制一条简单的线。

UserStyle 

样式 >= UserStyle 保留给派生类使用, 这些派生类用额外的应用特定方式重载 drawSeries() 来显示直方图。

构造及析构函数说明

◆ QwtPlotHistogram() [1/2]

QwtPlotHistogram::QwtPlotHistogram ( const QString &  title = QString())
explicit

QString标题的构造函数

◆ QwtPlotHistogram() [2/2]

QwtPlotHistogram::QwtPlotHistogram ( const QwtText title)
explicit

QwtText标题的构造函数

◆ ~QwtPlotHistogram()

QwtPlotHistogram::~QwtPlotHistogram ( )
virtual

析构函数

成员函数说明

◆ baseline()

double QwtPlotHistogram::baseline ( ) const

获取基线的值

◆ boundingRect()

QRectF QwtPlotHistogram::boundingRect ( ) const
overridevirtual

获取所有样本的边界矩形

重载 QwtPlotSeriesItem .

◆ brush()

const QBrush & QwtPlotHistogram::brush ( ) const

获取根据 style() 不同使用的画刷

◆ columnRect()

QwtColumnRect QwtPlotHistogram::columnRect ( const QwtIntervalSample sample,
const QwtScaleMap xMap,
const QwtScaleMap yMap 
) const
protectedvirtual

Calculate the area that is covered by a sample

参数
sampleSample
xMapMaps x-values into pixel coordinates.
yMapMaps y-values into pixel coordinates.
返回
Rectangle, that is covered by a sample

◆ drawColumn()

void QwtPlotHistogram::drawColumn ( QPainter *  painter,
const QwtColumnRect rect,
const QwtIntervalSample sample 
) const
protectedvirtual

Draw a column for a sample in Columns style().

When a symbol() has been set the symbol is used otherwise the column is displayed as plain rectangle using pen() and brush().

参数
painterPainter
rectRectangle where to paint the column in paint device coordinates
sampleSample to be displayed
注解
In applications, where different intervals need to be displayed in a different way ( f.e different colors or even using different symbols) it is recommended to overload drawColumn().

◆ drawColumns()

void QwtPlotHistogram::drawColumns ( QPainter *  painter,
const QwtScaleMap xMap,
const QwtScaleMap yMap,
int  from,
int  to 
) const
protected

Draw a histogram in Columns style()

参数
painterPainter
xMapMaps x-values into pixel coordinates.
yMapMaps y-values into pixel coordinates.
fromIndex of the first sample to be painted
toIndex of the last sample to be painted. If to < 0 the histogram will be painted to its last point.
参见
setStyle(), style(), setSymbol(), drawColumn()

◆ drawLines()

void QwtPlotHistogram::drawLines ( QPainter *  painter,
const QwtScaleMap xMap,
const QwtScaleMap yMap,
int  from,
int  to 
) const
protected

Draw a histogram in Lines style()

参数
painterPainter
xMapMaps x-values into pixel coordinates.
yMapMaps y-values into pixel coordinates.
fromIndex of the first sample to be painted
toIndex of the last sample to be painted. If to < 0 the histogram will be painted to its last point.
参见
setStyle(), style(), setPen()

◆ drawOutline()

void QwtPlotHistogram::drawOutline ( QPainter *  painter,
const QwtScaleMap xMap,
const QwtScaleMap yMap,
int  from,
int  to 
) const
protected

Draw a histogram in Outline style()

参数
painterPainter
xMapMaps x-values into pixel coordinates.
yMapMaps y-values into pixel coordinates.
fromIndex of the first sample to be painted
toIndex of the last sample to be painted. If to < 0 the histogram will be painted to its last point.
参见
setStyle(), style()
警告
The outline style requires, that the intervals are in increasing order and not overlapping.

◆ drawSeries()

void QwtPlotHistogram::drawSeries ( QPainter *  painter,
const QwtScaleMap xMap,
const QwtScaleMap yMap,
const QRectF &  canvasRect,
int  from,
int  to 
) const
overridevirtual

绘制直方图样本的子集

实现了 QwtPlotSeriesItem.

◆ legendIcon()

QwtGraphic QwtPlotHistogram::legendIcon ( int  index,
const QSizeF &  size 
) const
overridevirtual

A plain rectangle without pen using the brush()

参数
indexIndex of the legend entry ( ignored as there is only one )
sizeIcon size
返回
A graphic displaying the icon
参见
QwtPlotItem::setLegendIconSize(), QwtPlotItem::legendData()

重载 QwtPlotItem .

◆ pen()

const QPen & QwtPlotHistogram::pen ( ) const

获取根据 style() 不同使用的画笔

◆ rtti()

int QwtPlotHistogram::rtti ( ) const
overridevirtual

获取运行时类型信息

重载 QwtPlotItem .

◆ setBaseline()

void QwtPlotHistogram::setBaseline ( double  value)

设置基线的值

◆ setBrush()

void QwtPlotHistogram::setBrush ( const QBrush &  brush)

分配画刷,根据 style() 的不同而使用

◆ setPen() [1/2]

void QwtPlotHistogram::setPen ( const QColor &  color,
qreal  width = 0.0,
Qt::PenStyle  style = Qt::SolidLine 
)

构建并分配画笔

◆ setPen() [2/2]

void QwtPlotHistogram::setPen ( const QPen &  pen)

分配画笔,根据 style() 的不同而使用

◆ setSamples() [1/2]

void QwtPlotHistogram::setSamples ( const QVector< QwtIntervalSample > &  samples)

用样本数组初始化数据

◆ setSamples() [2/2]

void QwtPlotHistogram::setSamples ( QwtSeriesData< QwtIntervalSample > *  data)

分配样本序列

◆ setStyle()

void QwtPlotHistogram::setStyle ( HistogramStyle  style)

设置直方图的绘制样式

◆ setSymbol()

void QwtPlotHistogram::setSymbol ( const QwtColumnSymbol symbol)

分配符号

◆ style()

QwtPlotHistogram::HistogramStyle QwtPlotHistogram::style ( ) const

获取直方图的绘制样式

◆ symbol()

const QwtColumnSymbol * QwtPlotHistogram::symbol ( ) const

获取当前符号


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