Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
The QBackingStore class provides a drawing area for QWindow. More...
#include <qbackingstore.h>
Public Member Functions | |
QBackingStore (QWindow *window) | |
Constructs an empty surface for the given top-level window. | |
~QBackingStore () | |
Destroys this surface. | |
QWindow * | window () const |
Returns a pointer to the top-level window associated with this surface. | |
QPaintDevice * | paintDevice () |
Returns the paint device for this surface. | |
void | flush (const QRegion ®ion, QWindow *window=nullptr, const QPoint &offset=QPoint()) |
Flushes the given region from the specified window onto the screen. | |
void | resize (const QSize &size) |
Sets the size of the window surface to size. | |
QSize | size () const |
Returns the current size of the window surface. | |
bool | scroll (const QRegion &area, int dx, int dy) |
Scrolls the given area dx pixels to the right and dy downward; both dx and dy may be negative. | |
void | beginPaint (const QRegion &) |
Begins painting on the backing store surface in the given region. | |
void | endPaint () |
Ends painting. | |
void | setStaticContents (const QRegion ®ion) |
Set region as the static contents of this window. | |
QRegion | staticContents () const |
Returns a QRegion representing the area of the window that has static contents. | |
bool | hasStaticContents () const |
Returns a boolean indicating if this window has static contents or not. | |
QPlatformBackingStore * | handle () const |
Returns a pointer to the QPlatformBackingStore implementation. | |
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 \l{Raster Window Example}.
Definition at line 23 of file qbackingstore.h.
|
explicit |
Constructs an empty surface for the given top-level window.
Definition at line 81 of file qbackingstore.cpp.
QBackingStore::~QBackingStore | ( | ) |
Destroys this surface.
Definition at line 94 of file qbackingstore.cpp.
Begins painting on the backing store surface in the given region.
You should call this function before using the paintDevice() to paint.
Definition at line 117 of file qbackingstore.cpp.
void QBackingStore::endPaint | ( | ) |
Ends painting.
You should call this function after painting with the paintDevice() has ended.
Definition at line 175 of file qbackingstore.cpp.
void QBackingStore::flush | ( | const QRegion & | region, |
QWindow * | window = nullptr, | ||
const QPoint & | offset = QPoint() ) |
Flushes the given region from the specified window onto the screen.
The window must either be the top level window represented by this backingstore, or a non-transient child of that window. Passing \nullptr falls back to using the backingstore's top level window.
If the 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().
Definition at line 197 of file qbackingstore.cpp.
Referenced by testing.tools.encode_pdf_filter._SinkPdfStream::close().
QPlatformBackingStore * QBackingStore::handle | ( | ) | const |
Returns a pointer to the QPlatformBackingStore implementation.
Definition at line 352 of file qbackingstore.cpp.
bool QBackingStore::hasStaticContents | ( | ) | const |
Returns a boolean indicating if this window has static contents or not.
Definition at line 295 of file qbackingstore.cpp.
QPaintDevice * QBackingStore::paintDevice | ( | ) |
Returns the paint device for this surface.
Definition at line 157 of file qbackingstore.cpp.
Sets the size of the window surface to size.
Definition at line 232 of file qbackingstore.cpp.
bool QBackingStore::scroll | ( | const QRegion & | area, |
int | dx, | ||
int | dy ) |
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.
Definition at line 254 of file qbackingstore.cpp.
Set region as the static contents of this window.
Definition at line 271 of file qbackingstore.cpp.
QSize QBackingStore::size | ( | ) | const |
Returns the current size of the window surface.
Definition at line 243 of file qbackingstore.cpp.
QRegion QBackingStore::staticContents | ( | ) | const |
Returns a QRegion representing the area of the window that has static contents.
Definition at line 287 of file qbackingstore.cpp.
QWindow * QBackingStore::window | ( | ) | const |
Returns a pointer to the top-level window associated with this surface.
Definition at line 103 of file qbackingstore.cpp.