QBackingStore 类

The QBackingStore 类提供绘制区域为 QWindow . 更多...

头: #include <QBackingStore>
qmake: QT += gui
Since: Qt 5.0

公共函数

QBackingStore (QWindow * window )
~QBackingStore ()
void beginPaint (const QRegion & region )
void endPaint ()
void flush (const QRegion & region , QWindow * win = Q_NULLPTR, const QPoint & offset = QPoint())
QPlatformBackingStore * handle () const
bool hasStaticContents () const
QPaintDevice * paintDevice ()
void resize (const QSize & size )
bool scroll (const QRegion & area , int dx , int dy )
void setStaticContents (const QRegion & region )
QSize size () const
QRegion staticContents () const
QWindow * window () const

详细描述

The QBackingStore 类提供绘制区域为 QWindow .

QBackingStore enables the use of QPainter 进行描绘在 QWindow 按 RasterSurface 类型。其它方式渲染到 QWindow 是通过使用 OpenGL 采用 QOpenGLContext .

A QBackingStore contains a buffered representation of the window contents, and thus supports partial updates by using QPainter 以仅更新窗口内容的子区域。

QBackingStore might be used by an application that wants to use QPainter 没有 OpenGL 加速,且在没有额外开销下使用 QWidget or QGraphicsView UI stacks. For an example of how to use QBackingStore see the 光栅窗口范例 .

成员函数文档编制

QBackingStore:: QBackingStore ( QWindow * window )

构造空表面为给定顶层 window .

QBackingStore:: ~QBackingStore ()

销毁此表面。

void QBackingStore:: beginPaint (const QRegion & region )

This function is called before painting onto the surface begins, with the region in which the painting will occur.

另请参阅 endPaint () 和 paintDevice ().

void QBackingStore:: endPaint ()

This function is called after painting onto the surface has ended.

另请参阅 beginPaint () 和 paintDevice ().

void QBackingStore:: flush (const QRegion & region , QWindow * win = Q_NULLPTR, const QPoint & offset = QPoint())

刷新给定 region from the specified window win 到屏幕。

注意, offset parameter is currently unused.

QPlatformBackingStore *QBackingStore:: handle () const

返回指向 QPlatformBckingStore 实现的指针

bool QBackingStore:: hasStaticContents () const

返回指示此窗口是否拥有静态内容的 bool。

QPaintDevice *QBackingStore:: paintDevice ()

Implement this function to return the appropriate paint device.

void QBackingStore:: resize (const QSize & size )

将窗口表面大小设为 size .

另请参阅 size ().

bool QBackingStore:: scroll (const QRegion & area , int dx , int dy )

卷动给定 area dx 像素到右侧和 dy 向下;两者 dx and dy 可能为负值。

返回 true 如果卷动区域成功;否则 false。

void QBackingStore:: setStaticContents (const QRegion & region )

Set region 作为此窗口的静态内容。

另请参阅 staticContents ().

QSize QBackingStore:: size () const

返回窗口表面的当前大小。

QRegion QBackingStore:: staticContents () const

返回指针指向 QRegion that has the static contents of this window.

另请参阅 setStaticContents ().

QWindow *QBackingStore:: window () const

返回关联此表面的顶层窗口指针。