QBackingStore

PyQt5.QtGui.QBackingStore

Description

The QBackingStore class provides a drawing area for QWindow.

QBackingStore enables the use of QPainter to paint on a QWindow with type RasterSurface. The other way of rendering to a QWindow is through the use of OpenGL with QOpenGLContext.

A QBackingStore contains a buffered representation of the window contents, and thus supports partial updates by using QPainter to only update a sub region of the window contents.

QBackingStore might be used by an application that wants to use QPainter without OpenGL acceleration and without the extra overhead of using the QWidget or QGraphicsView UI stacks. For an example of how to use QBackingStore see the Raster Window Example.

Methods

__init__(QWindow)

TODO


beginPaint(QRegion)

Begins painting on the backing store surface in the given region.

You should call this function before using the paintDevice() to paint.


endPaint()

Ends painting.

You should call this function after painting with the paintDevice() has ended.


flush(QRegion, window: QWindow = None, offset: QPoint = QPoint())

TODO


hasStaticContents() → bool

Returns a boolean indicating if this window has static contents or not.


paintDevice() → QPaintDevice

Returns the paint device for this surface.

Warning: The device is only valid between calls to beginPaint() and endPaint(). You should not cache the returned value.


resize(QSize)

Sets the size of the window surface to size.

See also

size().


scroll(QRegion, int, int) → bool

Scrolls the given area dx pixels to the right and dy downward; both dx and dy may be negative.

Returns true if the area was scrolled successfully; false otherwise.


setStaticContents(QRegion)

Set region as the static contents of this window.

See also

staticContents().


size() → QSize

Returns the current size of the window surface.


staticContents() → QRegion

Returns a QRegion representing the area of the window that has static contents.


window() → QWindow

Returns a pointer to the top-level window associated with this surface.