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

Painter object trying to paint incrementally 更多...

#include <qwt_plot_directpainter.h>

类 QwtPlotDirectPainter 继承关系图:

class  PrivateData
 

Public 类型

enum  Attribute { AtomicPainter = 0x01 , FullRepaint = 0x02 , CopyBackingStore = 0x04 }
 Paint attributes 更多...
 

Public 成员函数

 QwtPlotDirectPainter (QObject *parent=nullptr)
 Constructor
 
void setAttribute (Attribute, bool on)
 Change an attribute
 
bool testAttribute (Attribute) const
 Test an attribute
 
void setClipping (bool)
 Enable or disable clipping
 
bool hasClipping () const
 Check if clipping is enabled
 
void setClipRegion (const QRegion &)
 Assign a clip region and enable clipping
 
QRegion clipRegion () const
 Get the currently set clip region
 
void drawSeries (QwtPlotSeriesItem *, int from, int to)
 Draw a set of points of a seriesItem
 
void reset ()
 Close the internal QPainter
 
virtual bool eventFilter (QObject *, QEvent *) override
 Event filter
 

详细描述

Painter object trying to paint incrementally

Often applications want to display samples while they are collected. When there are too many samples complete replots will be expensive to be processed in a collection cycle.

QwtPlotDirectPainter offers an API to paint subsets ( f.e all additions points ) without erasing/repainting the plot canvas.

On certain environments it might be important to calculate a proper clip region before painting. F.e. for Qt Embedded only the clipped part of the backing store will be copied to a ( maybe unaccelerated ) frame buffer.

警告
Incremental painting will only help when no replot is triggered by another operation ( like changing scales ) and nothing needs to be erased.

成员枚举类型说明

◆ Attribute

Paint attributes

参见
setAttribute(), testAttribute(), drawSeries()
枚举值
AtomicPainter 

Initializing a QPainter is an expensive operation. When AtomicPainter is set each call of drawSeries() opens/closes a temporary QPainter. Otherwise QwtPlotDirectPainter tries to use the same QPainter as long as possible. When FullRepaint is set the plot canvas is explicitly repainted after the samples have been rendered.

FullRepaint 

When QwtPlotCanvas::BackingStore is enabled the painter has to paint to the backing store and the widget. In certain situations/environments it might be faster to paint to the backing store only and then copy the backing store to the canvas. This flag can also be useful for settings, where Qt fills the the clip region with the widget background.

构造及析构函数说明

◆ QwtPlotDirectPainter()

QwtPlotDirectPainter::QwtPlotDirectPainter ( QObject *  parent = nullptr)
explicit

Constructor

参数
[in]parentParent object

Destructor

成员函数说明

◆ clipRegion()

QRegion QwtPlotDirectPainter::clipRegion ( ) const

Get the currently set clip region

返回
Currently set clip region
参见
setClipRegion(), setClipping(), hasClipping()

◆ drawSeries()

void QwtPlotDirectPainter::drawSeries ( QwtPlotSeriesItem seriesItem,
int  from,
int  to 
)

Draw a set of points of a seriesItem

When observing a measurement while it is running, new points have to be added to an existing seriesItem. drawSeries() can be used to display them avoiding a complete redraw of the canvas. Setting plot()->canvas()->setAttribute(Qt::WA_PaintOutsidePaintEvent, true); will result in faster painting, if the paint engine of the canvas widget supports this feature.

参数
[in]seriesItemItem to be painted
[in]fromIndex of the first point to be painted
[in]toIndex of the last point to be painted. If to < 0 the series will be painted to its last point.

◆ eventFilter()

bool QwtPlotDirectPainter::eventFilter ( QObject *  ,
QEvent *  event 
)
overridevirtual

Event filter

参数
[in]objectObject
[in]eventEvent
返回
True if the event was handled

◆ hasClipping()

bool QwtPlotDirectPainter::hasClipping ( ) const

Check if clipping is enabled

返回
true, when clipping is enabled
参见
setClipping(), clipRegion(), setClipRegion()

◆ setAttribute()

void QwtPlotDirectPainter::setAttribute ( Attribute  attribute,
bool  on 
)

Change an attribute

参数
[in]attributeAttribute to change
[in]onOn/Off
参见
Attribute, testAttribute()

◆ setClipping()

void QwtPlotDirectPainter::setClipping ( bool  enable)

Enable or disable clipping

参数
[in]enableEnables clipping if true, disables it otherwise
参见
hasClipping(), clipRegion(), setClipRegion()

◆ setClipRegion()

void QwtPlotDirectPainter::setClipRegion ( const QRegion &  region)

Assign a clip region and enable clipping

Depending on the environment setting a proper clip region might improve the performance heavily. E.g. on Qt embedded only the clipped part of the backing store will be copied to a (maybe unaccelerated) frame buffer device.

参数
[in]regionClip region
参见
clipRegion(), hasClipping(), setClipping()

◆ testAttribute()

bool QwtPlotDirectPainter::testAttribute ( Attribute  attribute) const

Test an attribute

参数
[in]attributeAttribute to be tested
返回
True, when attribute is enabled
参见
Attribute, setAttribute()

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