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

显示可由 QPainterPath 定义的任何图形形状的绘图项 更多...

#include <qwt_plot_shapeitem.h>

类 QwtPlotShapeItem 继承关系图:
QwtPlotItem

class  PrivateData
 

Public 类型

enum  PaintAttribute { ClipPolygons = 0x01 }
 绘制属性 更多...
 
enum  LegendMode { LegendShape , LegendColor }
 图例模式 更多...
 
- 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 成员函数

 QwtPlotShapeItem (const QString &title=QString())
 构造函数
 
 QwtPlotShapeItem (const QwtText &title)
 构造函数
 
virtual ~QwtPlotShapeItem ()
 析构函数
 
void setPaintAttribute (PaintAttribute, bool on=true)
 指定绘制形状的属性
 
bool testPaintAttribute (PaintAttribute) const
 检查绘制属性是否启用
 
void setLegendMode (LegendMode)
 设置在图例上显示项目的模式
 
LegendMode legendMode () const
 
void setRect (const QRectF &)
 Set a path built from a rectangle
 
void setPolygon (const QPolygonF &)
 Set a path built from a polygon
 
void setShape (const QPainterPath &)
 Set the shape to be displayed
 
QPainterPath shape () const
 
void setPen (const QColor &, qreal width=0.0, Qt::PenStyle=Qt::SolidLine)
 Build and assign a pen
 
void setPen (const QPen &)
 Assign a pen
 
QPen pen () const
 
void setBrush (const QBrush &)
 Assign a brush.
 
QBrush brush () const
 
void setRenderTolerance (double)
 Set the tolerance for the weeding optimization
 
double renderTolerance () const
 
virtual QRectF boundingRect () const override
 Bounding rectangle of the shape
 
virtual void draw (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const override
 Draw the shape item
 
virtual QwtGraphic legendIcon (int index, const QSizeF &) const override
 
virtual int rtti () const 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 updateScaleDiv (const QwtScaleDiv &, const QwtScaleDiv &)
 Update the item with new scale divisions
 
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
 

额外继承的成员函数

- Protected 成员函数 继承自 QwtPlotItem
QwtGraphic defaultIcon (const QBrush &, const QSizeF &) const
 Create a default icon
 

详细描述

显示可由 QPainterPath 定义的任何图形形状的绘图项

成员枚举类型说明

◆ LegendMode

图例模式

枚举值
LegendShape 

Display a scaled down version of the shape

LegendColor 

Display a filled rectangle

◆ PaintAttribute

绘制属性

枚举值
ClipPolygons 

在绘制多边形之前对其进行裁剪。在点远离可见区域的情况下(例如深度缩放时), 这可能会显著提高绘制性能

但多边形裁剪会将绘制路径转换为多边形,这可能会对由曲线或椭圆组成的路径的性能产生负面影响。

构造及析构函数说明

◆ QwtPlotShapeItem() [1/2]

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

构造函数

◆ QwtPlotShapeItem() [2/2]

QwtPlotShapeItem::QwtPlotShapeItem ( const QwtText title)
explicit

构造函数

◆ ~QwtPlotShapeItem()

QwtPlotShapeItem::~QwtPlotShapeItem ( )
virtual

析构函数

成员函数说明

◆ boundingRect()

QRectF QwtPlotShapeItem::boundingRect ( ) const
overridevirtual

Bounding rectangle of the shape

重载 QwtPlotItem .

◆ brush()

QBrush QwtPlotShapeItem::brush ( ) const
返回
Brush used to fill the shape
参见
setBrush(), pen()

◆ draw()

void QwtPlotShapeItem::draw ( QPainter *  painter,
const QwtScaleMap xMap,
const QwtScaleMap yMap,
const QRectF &  canvasRect 
) const
overridevirtual

Draw the shape item

参数
painterPainter
xMapX-Scale Map
yMapY-Scale Map
canvasRectContents rect of the plot canvas

实现了 QwtPlotItem.

◆ legendIcon()

QwtGraphic QwtPlotShapeItem::legendIcon ( int  index,
const QSizeF &  size 
) const
overridevirtual
返回
A rectangle filled with the color of the brush ( or the pen )
参数
indexIndex of the legend entry ( usually there is only one )
sizeIcon size
参见
setLegendIconSize(), legendData()

重载 QwtPlotItem .

◆ legendMode()

QwtPlotShapeItem::LegendMode QwtPlotShapeItem::legendMode ( ) const
返回
Mode how to represent the item on the legend
参见
legendMode()

◆ pen()

QPen QwtPlotShapeItem::pen ( ) const
返回
Pen used to draw the outline of the shape
参见
setPen(), brush()

◆ renderTolerance()

double QwtPlotShapeItem::renderTolerance ( ) const
返回
Tolerance for the weeding optimization
参见
setRenderTolerance()

◆ rtti()

int QwtPlotShapeItem::rtti ( ) const
overridevirtual

获取运行时类型信息

重载 QwtPlotItem .

◆ setBrush()

void QwtPlotShapeItem::setBrush ( const QBrush &  brush)

Assign a brush.

The brush is used to fill the path

参数
brushBrush
参见
brush(), pen()

◆ setLegendMode()

void QwtPlotShapeItem::setLegendMode ( LegendMode  mode)

设置在图例上显示项目的模式

◆ setPaintAttribute()

void QwtPlotShapeItem::setPaintAttribute ( PaintAttribute  attribute,
bool  on = true 
)

指定绘制形状的属性

◆ setPen() [1/2]

void QwtPlotShapeItem::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.

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

◆ setPen() [2/2]

void QwtPlotShapeItem::setPen ( const QPen &  pen)

Assign a pen

The pen is used to draw the outline of the shape

参数
penPen
参见
pen(), brush()

◆ setPolygon()

void QwtPlotShapeItem::setPolygon ( const QPolygonF &  polygon)

Set a path built from a polygon

参数
polygonPolygon
参见
setShape(), setRect(), shape()

◆ setRect()

void QwtPlotShapeItem::setRect ( const QRectF &  rect)

Set a path built from a rectangle

参数
rectRectangle
参见
setShape(), setPolygon(), shape()

◆ setRenderTolerance()

void QwtPlotShapeItem::setRenderTolerance ( double  tolerance)

Set the tolerance for the weeding optimization

After translating the shape into target device coordinate ( usually widget geometries ) the painter path can be simplified by a point weeding algorithm ( Douglas-Peucker ).

For shapes built from curves and ellipses weeding might have the opposite effect because they have to be expanded to polygons.

参数
toleranceAccepted error when reducing the number of points A value <= 0.0 disables weeding.
参见
renderTolerance(), QwtWeedingCurveFitter

◆ setShape()

void QwtPlotShapeItem::setShape ( const QPainterPath &  shape)

Set the shape to be displayed

参数
shapeShape
参见
setShape(), shape()

◆ shape()

QPainterPath QwtPlotShapeItem::shape ( ) const
返回
Shape to be displayed
参见
setShape()

◆ testPaintAttribute()

bool QwtPlotShapeItem::testPaintAttribute ( PaintAttribute  attribute) const

检查绘制属性是否启用


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