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

在绘图画布内绘制图例的类 更多...

#include <qwt_plot_legenditem.h>

类 QwtPlotLegendItem 继承关系图:
QwtPlotItem

class  PrivateData
 

Public 类型

enum  BackgroundMode { LegendBackground , ItemBackground }
 背景模式 更多...
 
- 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 成员函数

 QwtPlotLegendItem ()
 Constructor
 
virtual ~QwtPlotLegendItem ()
 Destructor
 
virtual int rtti () const override
 Get the runtime type information
 
void setAlignmentInCanvas (Qt::Alignment)
 Set the alignment in canvas
 
Qt::Alignment alignmentInCanvas () const
 Get the alignment in canvas
 
void setOffsetInCanvas (Qt::Orientations, int numPixels)
 Set the offset in canvas
 
int offsetInCanvas (Qt::Orientation) const
 Get the offset in canvas
 
void setMaxColumns (uint)
 Set the maximum number of columns
 
uint maxColumns () const
 Get the maximum number of columns
 
void setMargin (int)
 Set the margin
 
int margin () const
 Get the margin
 
void setSpacing (int)
 Set the spacing
 
int spacing () const
 Get the spacing
 
void setItemMargin (int)
 Set the item margin
 
int itemMargin () const
 Get the item margin
 
void setItemSpacing (int)
 Set the item spacing
 
int itemSpacing () const
 Get the item spacing
 
void setFont (const QFont &)
 Set the font
 
QFont font () const
 Get the font
 
void setBorderRadius (double)
 Set the border radius
 
double borderRadius () const
 Get the border radius
 
void setBorderPen (const QPen &)
 Set the border pen
 
QPen borderPen () const
 Get the border pen
 
void setBackgroundBrush (const QBrush &)
 Set the background brush
 
QBrush backgroundBrush () const
 Get the background brush
 
void setBackgroundMode (BackgroundMode)
 Set the background mode
 
BackgroundMode backgroundMode () const
 Get the background mode
 
void setTextPen (const QPen &)
 Set the text pen
 
QPen textPen () const
 Get the text pen
 
virtual void draw (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const override
 Draw the legend item
 
void clearLegend ()
 Clear the legend
 
virtual void updateLegend (const QwtPlotItem *, const QList< QwtLegendData > &) override
 Update the legend
 
virtual QRect geometry (const QRectF &canvasRect) const
 Get the geometry
 
virtual QSize minimumSize (const QwtLegendData &) const
 Get the minimum size
 
virtual int heightForWidth (const QwtLegendData &, int width) const
 Get the height for width
 
QList< const QwtPlotItem * > plotItems () const
 Get the plot items
 
QList< QRect > legendGeometries (const QwtPlotItem *) const
 Get the legend geometries
 
- 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 QRectF boundingRect () const
 Get the bounding rectangle
 
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
 
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
 
virtual QwtGraphic legendIcon (int index, const QSizeF &) const
 Return a legend icon
 

Protected 成员函数

virtual void drawLegendData (QPainter *, const QwtPlotItem *, const QwtLegendData &, const QRectF &) const
 Draw the legend data
 
virtual void drawBackground (QPainter *, const QRectF &rect) const
 Draw the background
 
- Protected 成员函数 继承自 QwtPlotItem
QwtGraphic defaultIcon (const QBrush &, const QSizeF &) const
 Create a default icon
 

详细描述

在绘图画布内绘制图例的类

成员枚举类型说明

◆ BackgroundMode

背景模式

枚举值
LegendBackground 

The legend has a background

ItemBackground 

Each item has a background

构造及析构函数说明

◆ QwtPlotLegendItem()

QwtPlotLegendItem::QwtPlotLegendItem ( )
explicit

Constructor

构造函数

◆ ~QwtPlotLegendItem()

QwtPlotLegendItem::~QwtPlotLegendItem ( )
virtual

Destructor

析构函数

成员函数说明

◆ alignmentInCanvas()

Qt::Alignment QwtPlotLegendItem::alignmentInCanvas ( ) const

Get the alignment in canvas

获取对齐标志

◆ backgroundBrush()

QBrush QwtPlotLegendItem::backgroundBrush ( ) const

Get the background brush

获取用于填充背景的画刷

◆ backgroundMode()

QwtPlotLegendItem::BackgroundMode QwtPlotLegendItem::backgroundMode ( ) const

Get the background mode

获取背景模式

◆ borderPen()

QPen QwtPlotLegendItem::borderPen ( ) const

Get the border pen

获取用于绘制边框的画笔

◆ borderRadius()

double QwtPlotLegendItem::borderRadius ( ) const

Get the border radius

获取边框半径

◆ clearLegend()

void QwtPlotLegendItem::clearLegend ( )

Clear the legend

从图例中移除所有项目

◆ draw()

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

Draw the legend item

绘制图例

实现了 QwtPlotItem.

◆ drawBackground()

void QwtPlotLegendItem::drawBackground ( QPainter *  painter,
const QRectF &  rect 
) const
protectedvirtual

Draw the background

Draw a rounded rect

参数
painterPainter
rectBounding rectangle
参见
setBorderRadius(), setBorderPen(), setBackgroundBrush(), setBackgroundMode()

◆ drawLegendData()

void QwtPlotLegendItem::drawLegendData ( QPainter *  painter,
const QwtPlotItem plotItem,
const QwtLegendData data,
const QRectF &  rect 
) const
protectedvirtual

Draw the legend data

Draw an entry on the legend

参数
painterQt Painter
plotItemPlot item, represented by the entry
dataAttributes of the legend entry
rectBounding rectangle for the entry

◆ font()

QFont QwtPlotLegendItem::font ( ) const

Get the font

获取用于绘制文本标签的字体

◆ geometry()

QRect QwtPlotLegendItem::geometry ( const QRectF &  canvasRect) const
virtual

Get the geometry

计算图例在画布上的几何形状

◆ heightForWidth()

int QwtPlotLegendItem::heightForWidth ( const QwtLegendData data,
int  width 
) const
virtual

Get the height for width

获取给定宽度的首选高度

◆ itemMargin()

int QwtPlotLegendItem::itemMargin ( ) const

Get the item margin

获取每个项目周围的边距

◆ itemSpacing()

int QwtPlotLegendItem::itemSpacing ( ) const

Get the item spacing

获取每个项目内部的间距

◆ legendGeometries()

QList< QRect > QwtPlotLegendItem::legendGeometries ( const QwtPlotItem plotItem) const

Get the legend geometries

获取绘图项的项目的几何形状

◆ margin()

int QwtPlotLegendItem::margin ( ) const

Get the margin

获取图例项周围的边距

◆ maxColumns()

uint QwtPlotLegendItem::maxColumns ( ) const

Get the maximum number of columns

获取最大列数

◆ minimumSize()

QSize QwtPlotLegendItem::minimumSize ( const QwtLegendData data) const
virtual

Get the minimum size

获取显示条目所需的最小尺寸提示

◆ offsetInCanvas()

int QwtPlotLegendItem::offsetInCanvas ( Qt::Orientation  orientation) const

Get the offset in canvas

获取图例与画布边缘之间的距离

◆ plotItems()

QList< const QwtPlotItem * > QwtPlotLegendItem::plotItems ( ) const

Get the plot items

获取图例上有条目的所有绘图项

◆ rtti()

int QwtPlotLegendItem::rtti ( ) const
overridevirtual

Get the runtime type information

获取运行时类型信息

重载 QwtPlotItem .

◆ setAlignmentInCanvas()

void QwtPlotLegendItem::setAlignmentInCanvas ( Qt::Alignment  alignment)

Set the alignment in canvas

设置图例在画布内的对齐方式

◆ setBackgroundBrush()

void QwtPlotLegendItem::setBackgroundBrush ( const QBrush &  brush)

Set the background brush

设置背景画刷

◆ setBackgroundMode()

void QwtPlotLegendItem::setBackgroundMode ( BackgroundMode  mode)

Set the background mode

设置背景模式

◆ setBorderPen()

void QwtPlotLegendItem::setBorderPen ( const QPen &  pen)

Set the border pen

设置用于绘制边框的画笔

◆ setBorderRadius()

void QwtPlotLegendItem::setBorderRadius ( double  radius)

Set the border radius

设置边框半径

◆ setFont()

void QwtPlotLegendItem::setFont ( const QFont &  font)

Set the font

更改用于绘制文本标签的字体

◆ setItemMargin()

void QwtPlotLegendItem::setItemMargin ( int  margin)

Set the item margin

设置每个项目周围的边距

◆ setItemSpacing()

void QwtPlotLegendItem::setItemSpacing ( int  spacing)

Set the item spacing

设置每个项目内部的间距

◆ setMargin()

void QwtPlotLegendItem::setMargin ( int  margin)

Set the margin

设置图例项周围的边距

◆ setMaxColumns()

void QwtPlotLegendItem::setMaxColumns ( uint  maxColumns)

Set the maximum number of columns

限制列数

◆ setOffsetInCanvas()

void QwtPlotLegendItem::setOffsetInCanvas ( Qt::Orientations  orientations,
int  numPixels 
)

Set the offset in canvas

设置图例与画布边缘之间的距离

◆ setSpacing()

void QwtPlotLegendItem::setSpacing ( int  spacing)

Set the spacing

设置图例项之间的间距

◆ setTextPen()

void QwtPlotLegendItem::setTextPen ( const QPen &  pen)

Set the text pen

设置用于绘制文本标签的画笔

◆ spacing()

int QwtPlotLegendItem::spacing ( ) const

Get the spacing

获取图例项之间的间距

◆ textPen()

QPen QwtPlotLegendItem::textPen ( ) const

Get the text pen

获取用于绘制文本标签的画笔

◆ updateLegend()

void QwtPlotLegendItem::updateLegend ( const QwtPlotItem plotItem,
const QList< QwtLegendData > &  data 
)
overridevirtual

Update the legend

根据绘图项的修改更新图例项

重载 QwtPlotItem .


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