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

返迴關聯此錶麵的頂層窗口指針。