QBackingStore¶
The
QBackingStore
class provides a drawing area forQWindow
. More…
Synopsis¶
Functions¶
def
beginPaint
(arg__1)def
endPaint
()def
flush
(region[, window=None[, offset=QPoint()]])def
hasStaticContents
()def
paintDevice
()def
resize
(size)def
scroll
(area, dx, dy)def
setStaticContents
(region)def
size
()def
staticContents
()def
window
()
Detailed Description¶
QBackingStore
enables the use ofQPainter
to paint on aQWindow
with type RasterSurface. The other way of rendering to aQWindow
is through the use of OpenGL withQOpenGLContext
.A
QBackingStore
contains a buffered representation of the window contents, and thus supports partial updates by usingQPainter
to only update a sub region of the window contents.
QBackingStore
might be used by an application that wants to useQPainter
without OpenGL acceleration and without the extra overhead of using theQWidget
orQGraphicsView
UI stacks. For an example of how to useQBackingStore
see the Raster Window Example .
- class PySide2.QtGui.QBackingStore(window)¶
- param window:
Constructs an empty surface for the given top-level
window
.
- PySide2.QtGui.QBackingStore.beginPaint(arg__1)¶
- Parameters:
arg__1 –
PySide2.QtGui.QRegion
Begins painting on the backing store surface in the given
region
.You should call this function before using the
paintDevice()
to paint.See also
- PySide2.QtGui.QBackingStore.endPaint()¶
Ends painting.
You should call this function after painting with the
paintDevice()
has ended.See also
- PySide2.QtGui.QBackingStore.flush(region[, window=None[, offset=QPoint()]])¶
- Parameters:
region –
PySide2.QtGui.QRegion
window –
PySide2.QtGui.QWindow
offset –
PySide2.QtCore.QPoint
Flushes the given
region
from the specifiedwindow
onto the screen.The
window
must either be the top level window represented by this backingstore, or a non-transient child of that window. PassingNone
falls back to using the backingstore’s top level window.If the
window
is a child window, theregion
should be in child window coordinates, and theoffset
should be the child window’s offset in relation to the backingstore’s top level window.You should call this function after ending painting with
endPaint()
.
- PySide2.QtGui.QBackingStore.hasStaticContents()¶
- Return type:
bool
Returns a boolean indicating if this window has static contents or not.
- PySide2.QtGui.QBackingStore.paintDevice()¶
- Return type:
Returns the paint device for this surface.
Warning
The device is only valid between calls to
beginPaint()
andendPaint()
. You should not cache the returned value.
- PySide2.QtGui.QBackingStore.resize(size)¶
- Parameters:
size –
PySide2.QtCore.QSize
Sets the size of the window surface to
size
.See also
- PySide2.QtGui.QBackingStore.scroll(area, dx, dy)¶
- Parameters:
area –
PySide2.QtGui.QRegion
dx – int
dy – int
- Return type:
bool
Scrolls the given
area
dx
pixels to the right anddy
downward; bothdx
anddy
may be negative.Returns
true
if the area was scrolled successfully; false otherwise.
- PySide2.QtGui.QBackingStore.setStaticContents(region)¶
- Parameters:
region –
PySide2.QtGui.QRegion
Set
region
as the static contents of this window.See also
- PySide2.QtGui.QBackingStore.size()¶
- Return type:
Returns the current size of the window surface.
- PySide2.QtGui.QBackingStore.staticContents()¶
- Return type:
Returns a
QRegion
representing the area of the window that has static contents.See also
- PySide2.QtGui.QBackingStore.window()¶
- Return type:
Returns a pointer to the top-level window associated with this surface.
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.