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

Base class for items on a polar plot 更多...

#include <qwt_polar_item.h>

类 QwtPolarItem 继承关系图:
QwtPolarCurve QwtPolarGrid QwtPolarMarker QwtPolarSpectrogram

class  PrivateData
 

Public 类型

enum  RttiValues {
  Rtti_PolarItem = 0 , Rtti_PolarGrid , Rtti_PolarMarker , Rtti_PolarCurve ,
  Rtti_PolarSpectrogram , Rtti_PolarUserItem = 1000
}
 Runtime type information 更多...
 
enum  ItemAttribute { Legend = 0x01 , AutoScale = 0x02 }
 Plot Item Attributes 更多...
 
enum  RenderHint { RenderAntialiased = 0x01 }
 Render hints 更多...
 

Public 成员函数

 QwtPolarItem (const QwtText &title=QwtText())
 Constructor
 
virtual ~QwtPolarItem ()
 Destructor
 
void attach (QwtPolarPlot *plot)
 Attach the item to a plot
 
void detach ()
 Detach the item from its plot
 
QwtPolarPlotplot () const
 Get the attached plot
 
void setTitle (const QString &title)
 Set the title from a QString
 
void setTitle (const QwtText &title)
 Set the title from a QwtText
 
const QwtTexttitle () const
 Get the title
 
virtual int rtti () const
 Get the runtime type information
 
void setItemAttribute (ItemAttribute, bool on=true)
 Set an item attribute
 
bool testItemAttribute (ItemAttribute) const
 Test an item attribute
 
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
 
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
 Get the visibility
 
virtual void itemChanged ()
 Update the item and trigger autoRefresh
 
virtual void legendChanged ()
 Update the legend
 
virtual void draw (QPainter *painter, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, double radius, const QRectF &canvasRect) const =0
 Draw the item
 
virtual QwtInterval boundingInterval (int scaleId) const
 Get the bounding interval for a scale
 
virtual void updateScaleDiv (const QwtScaleDiv &, const QwtScaleDiv &, const QwtInterval &)
 Update the scale division
 
virtual int marginHint () const
 Get the margin hint
 
void setLegendIconSize (const QSize &)
 Set the legend icon size
 
QSize legendIconSize () const
 Get the legend icon size
 
virtual QList< QwtLegendDatalegendData () const
 Get the legend data
 
virtual QwtGraphic legendIcon (int index, const QSizeF &) const
 Get the legend icon
 

详细描述

Base class for items on a polar plot

A QwtPolarItem is "something that can be painted on the canvas". It is connected to the QwtPolar framework by a couple of virtual methods, that are individually implemented in derived item classes. QwtPolar offers an implementation of the most common types of items, but deriving from QwtPolarItem makes it easy to implement additional types of items.

成员枚举类型说明

◆ ItemAttribute

Plot Item Attributes

参见
setItemAttribute(), testItemAttribute()
枚举值
Legend 

The item is represented on the legend.

AutoScale 

The boundingRect() of the item is included in the autoscaling calculation.

◆ RenderHint

Render hints

参见
setRenderHint(), testRenderHint()
枚举值
RenderAntialiased 

Enable antialiasing

◆ RttiValues

Runtime type information

RttiValues is used to cast plot items, without having to enable runtime type information of the compiler.

枚举值
Rtti_PolarItem 

Unspecific value, that can be used, when it doesn't matter

Rtti_PolarGrid 

For QwtPolarGrid

Rtti_PolarMarker 

For QwtPolarMarker

Rtti_PolarCurve 

For QwtPolarCurve

Rtti_PolarSpectrogram 

For QwtPolarSpectrogram

Rtti_PolarUserItem 

Values >= Rtti_PolarUserItem are reserved for plot items not implemented in the QwtPolar library.

构造及析构函数说明

◆ QwtPolarItem()

QwtPolarItem::QwtPolarItem ( const QwtText title = QwtText())
explicit

Constructor

参数
titleItem title, f.e used on a legend
参见
setTitle()

成员函数说明

◆ attach()

void QwtPolarItem::attach ( QwtPolarPlot plot)

Attach the item to a plot

This method will attach a QwtPolarItem to the QwtPolarPlot argument. It will first detach the QwtPolarItem from any plot from a previous call to attach (if necessary). If a nullptr argument is passed, it will detach from any QwtPolarPlot it was attached to.

参数
plotPlot widget
参见
QwtPolarItem::detach()

◆ boundingInterval()

QwtInterval QwtPolarItem::boundingInterval ( int  scaleId) const
virtual

Get the bounding interval for a scale

Interval, that is necessary to display the item. This interval can be useful for operations like clipping or autoscaling. For items (like the grid), where a bounding interval makes no sense, an invalid interval is returned.

参数
scaleIdScale id ( QwtPolar::Scale )
返回
Bounding interval of the plot item for a specific scale

QwtPolarCurve, QwtPolarMarker , 以及 QwtPolarSpectrogram 重载.

◆ detach()

void QwtPolarItem::detach ( )

Detach the item from its plot

Detach the item from its associated plot

This method detaches a QwtPolarItem from the QwtPolarPlot it has been associated with. detach() is equivalent to calling attach( nullptr ).

参见
attach()

◆ draw()

virtual void QwtPolarItem::draw ( QPainter *  painter,
const QwtScaleMap azimuthMap,
const QwtScaleMap radialMap,
const QPointF &  pole,
double  radius,
const QRectF &  canvasRect 
) const
pure virtual

Draw the item

参数
painterPainter
azimuthMapMaps azimuth values to values related to 0.0, M_2PI
radialMapMaps radius values into painter coordinates
polePosition of the pole in painter coordinates
radiusRadius of the complete plot area in painter coordinates
canvasRectContents rect of the canvas in painter coordinates

QwtPolarCurve, QwtPolarGrid, QwtPolarMarker , 以及 QwtPolarSpectrogram 内被实现.

◆ isVisible()

bool QwtPolarItem::isVisible ( ) const

Get the visibility

Check if the item is visible

返回
true if visible
参见
setVisible(), show(), hide()

◆ itemChanged()

void QwtPolarItem::itemChanged ( )
virtual

Update the item and trigger autoRefresh

Update the legend and call QwtPolarPlot::autoRefresh for the parent plot

参见
updateLegend()

◆ legendChanged()

void QwtPolarItem::legendChanged ( )
virtual

Update the legend

Update the legend of the parent plot

参见
QwtPolarPlot::updateLegend(), itemChanged()

◆ legendData()

QList< QwtLegendData > QwtPolarItem::legendData ( ) const
virtual

Get the legend data

Return all information that is needed to represent the item on the legend

Most items are represented by one entry on the legend showing an icon and a text. QwtLegendData is basically a list of QVariants that makes it possible to overload and reimplement legendData() to return almost any type of information, that is understood by the receiver that acts as the legend. The default implementation returns one entry with the title() of the item and the legendIcon().

返回
List of legend data
参见
title(), legendIcon(), QwtLegend

◆ legendIcon()

QwtGraphic QwtPolarItem::legendIcon ( int  index,
const QSizeF &  size 
) const
virtual

Get the legend icon

Get icon representing the item on the legend

The default implementation returns an invalid icon.

参数
indexIndex of the legend entry (usually there is only one)
sizeIcon size
返回
Icon representing the item on the legend
参见
setLegendIconSize(), legendData()

QwtPolarCurve 重载.

◆ legendIconSize()

QSize QwtPolarItem::legendIconSize ( ) const

Get the legend icon size

返回
Legend icon size
参见
setLegendIconSize(), legendIcon()

◆ marginHint()

int QwtPolarItem::marginHint ( ) const
virtual

Get the margin hint

Some items like to display something (f.e. the azimuth axis) outside of the area of the interval of the radial scale. The default implementation returns 0 pixels.

返回
Hint for the margin

QwtPolarGrid 重载.

◆ plot()

QwtPolarPlot * QwtPolarItem::plot ( ) const

Get the attached plot

返回
Attached plot

◆ renderThreadCount()

uint QwtPolarItem::renderThreadCount ( ) const

Get the number of render threads

返回
Number of threads to be used for rendering. If numThreads() is set to 0, the system specific ideal thread count is used.

◆ rtti()

int QwtPolarItem::rtti ( ) const
virtual

Get the runtime type information

Get runtime type information for the specific class represented

QwtPolarItem is simply a virtual interface class, and base classes will implement this method with specific rtti values so a user can differentiate them. The rtti value is useful for environments where the runtime type information is disabled and it is not possible to do a dynamic_cast<...>.

返回
rtti value
参见
RttiValues

QwtPolarCurve, QwtPolarGrid, QwtPolarMarker , 以及 QwtPolarSpectrogram 重载.

◆ setItemAttribute()

void QwtPolarItem::setItemAttribute ( ItemAttribute  attribute,
bool  on = true 
)

Set an item attribute

Toggle an item attribute

参数
attributeAttribute type
ontrue/false
参见
testItemAttribute(), ItemAttribute

◆ setLegendIconSize()

void QwtPolarItem::setLegendIconSize ( const QSize &  size)

Set the legend icon size

Set the size of the legend icon

The default setting is 8x8 pixels.

参数
sizeSize
参见
legendIconSize(), legendIcon()

◆ setRenderHint()

void QwtPolarItem::setRenderHint ( RenderHint  hint,
bool  on = true 
)

Set a render hint

Toggle a render hint

参数
hintRender hint
ontrue/false
参见
testRenderHint(), RenderHint

◆ setRenderThreadCount()

void QwtPolarItem::setRenderThreadCount ( uint  numThreads)

Set the number of render threads

On multi core systems rendering of certain plot item (f.e QwtPolarSpectrogram) can be done in parallel in several threads. The default setting is set to 1.

参数
numThreadsNumber of threads to be used for rendering. If numThreads is set to 0, the system specific ideal thread count is used. The default thread count is 1 ( = no additional threads ).

◆ setTitle() [1/2]

void QwtPolarItem::setTitle ( const QString &  title)

Set the title from a QString

Set a new title

参数
titleTitle
参见
title()

◆ setTitle() [2/2]

void QwtPolarItem::setTitle ( const QwtText title)

Set the title from a QwtText

Set a new title

参数
titleTitle
参见
title()

◆ setVisible()

void QwtPolarItem::setVisible ( bool  on)
virtual

Set the visibility

Show/Hide the item

参数
onShow if true, otherwise hide
参见
isVisible(), show(), hide()

◆ setZ()

void QwtPolarItem::setZ ( double  z)

Set the z value

Plot items are painted in increasing z-order.

参数
zZ-value
参见
z(), QwtPolarItemDict::itemList()

◆ testItemAttribute()

bool QwtPolarItem::testItemAttribute ( ItemAttribute  attribute) const

Test an item attribute

参数
attributeAttribute type
返回
true/false
参见
setItemAttribute(), ItemAttribute

◆ testRenderHint()

bool QwtPolarItem::testRenderHint ( RenderHint  hint) const

Test a render hint

参数
hintRender hint
返回
true/false
参见
setRenderHint(), RenderHint

◆ title()

const QwtText & QwtPolarItem::title ( ) const

Get the title

Get the title of the item

返回
Title of the item
参见
setTitle()

◆ updateScaleDiv()

void QwtPolarItem::updateScaleDiv ( const QwtScaleDiv azimuthScaleDiv,
const QwtScaleDiv radialScaleDiv,
const QwtInterval interval 
)
virtual

Update the scale division

Update the item to changes of the axes scale division

Update the item, when the axes of plot have changed. The default implementation does nothing, but items that depend on the scale division (like QwtPolarGrid()) have to reimplement updateScaleDiv().

参数
azimuthScaleDivScale division of the azimuth-scale
radialScaleDivScale division of the radius-axis
intervalThe interval of the radius-axis, that is visible on the canvas
参见
QwtPolarPlot::updateAxes()

QwtPolarGrid 重载.

◆ z()

double QwtPolarItem::z ( ) const

Get the z value

Plot items are painted in increasing z-order.

返回
Z value
参见
setZ(), QwtPolarItemDict::itemList()

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