CopperSpice API  1.9.2
QBackingStore Class Reference

Provides a drawing area for QWindow. More...

Public Methods

 QBackingStore (QWindow *window)
 
 ~QBackingStore ()
 
void beginPaint (const QRegion &region)
 
void endPaint ()
 
void flush (const QRegion &region, QWindow *window=nullptr, const QPoint &offset=QPoint ())
 
QPlatformBackingStorehandle () const
 
bool hasStaticContents () const
 
QPaintDevicepaintDevice ()
 
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
 
QWindowwindow () const
 

Detailed 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.

Constructor & Destructor Documentation

QBackingStore::QBackingStore ( QWindow window)
explicit

Constructs an empty surface for the given top level window.

QBackingStore::~QBackingStore ( )

Destroys this surface.

Method Documentation

void QBackingStore::beginPaint ( const QRegion region)

This method is called before painting onto the surface begins, with the region in which the painting will occur.

See also
endPaint(), paintDevice()
void QBackingStore::endPaint ( )

This method is called after painting onto the surface has ended.

See also
beginPaint(), paintDevice()
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 offset parameter is currently unused.

QPlatformBackingStore * QBackingStore::handle ( ) const

Returns a pointer to the QPlatformBackingStore implementation.

bool QBackingStore::hasStaticContents ( ) const

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

QPaintDevice * QBackingStore::paintDevice ( )

Implement this function to return the appropriate paint device.

void QBackingStore::resize ( const QSize size)

Sets the size of the windowsurface to be size.

See also
size()
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.

void QBackingStore::setStaticContents ( const QRegion region)

Set region as the static contents of this window.

See also
staticContents()
QSize QBackingStore::size ( ) const

Returns the current size of the windowsurface.

QRegion QBackingStore::staticContents ( ) const

Returns a pointer to the QRegion that has the static contents of this window.

See also
setStaticContents()
QWindow * QBackingStore::window ( ) const

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