QBackingStoreclass provides a drawing area forQWindow. 更多 …
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
()
QBackingStoreenables the use ofQPainterto paint on aQWindowwith type RasterSurface. The other way of rendering to aQWindowis through the use of OpenGL withQOpenGLContext.A
QBackingStorecontains a buffered representation of the window contents, and thus supports partial updates by usingQPainterto only update a sub region of the window contents.
QBackingStoremight be used by an application that wants to useQPainterwithout OpenGL acceleration and without the extra overhead of using theQWidgetorQGraphicsViewUI stacks. For an example of how to useQBackingStoresee the 光栅窗口范例 .
QBackingStore
(
window
)
¶
- param window
Constructs an empty surface for the given top-level
window
.
PySide2.QtGui.QBackingStore.
beginPaint
(
arg__1
)
¶
arg__1
–
QRegion
Begins painting on the backing store surface in the given
region
.
You should call this function before using the
paintDevice()
to paint.
另请参阅
PySide2.QtGui.QBackingStore.
endPaint
(
)
¶
Ends painting.
You should call this function after painting with the
paintDevice()
has ended.
PySide2.QtGui.QBackingStore.
flush
(
region
[
,
window=None
[
,
offset=QPoint()
]
]
)
¶
Flushes the given
region
from the specified
window
onto the screen.
window
must either be the top level window represented by this backingstore, or a non-transient child of that window. Passing
None
falls back to using the backingstore’s top level window.
若
window
is a child window, the
region
should be in child window coordinates, and the
offset
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
(
)
¶
bool
Returns a boolean indicating if this window has static contents or not.
PySide2.QtGui.QBackingStore.
paintDevice
(
)
¶
Returns the paint device for this surface.
警告
The device is only valid between calls to
beginPaint()
and
endPaint()
. You should not cache the returned value.
PySide2.QtGui.QBackingStore.
resize
(
size
)
¶
size
–
QSize
Sets the size of the window surface to
size
.
另请参阅
PySide2.QtGui.QBackingStore.
scroll
(
area
,
dx
,
dy
)
¶
area
–
QRegion
dx
–
int
dy
–
int
bool
Scrolls the given
area
dx
像素到右侧和
dy
downward; both
dx
and
dy
可能为负值。
返回
true
if the area was scrolled successfully; false otherwise.
PySide2.QtGui.QBackingStore.
setStaticContents
(
region
)
¶
region
–
QRegion
Set
region
as the static contents of this window.
另请参阅
PySide2.QtGui.QBackingStore.
size
(
)
¶
QSize
Returns the current size of the window surface.