Struct qt_gui::QBackingStore

source ·
#[repr(C)]
pub struct QBackingStore { /* private fields */ }
Expand description

The QBackingStore class provides a drawing area for QWindow.

C++ class: QBackingStore.

C++ documentation:

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.

Implementations§

source§

impl QBackingStore

source

pub unsafe fn begin_paint(&self, arg1: impl CastInto<Ref<QRegion>>)

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

Calls C++ function: void QBackingStore::beginPaint(const QRegion& arg1).

C++ documentation:

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

See also endPaint() and paintDevice().

source

pub unsafe fn end_paint(&self)

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

Calls C++ function: void QBackingStore::endPaint().

C++ documentation:

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

See also beginPaint() and paintDevice().

source

pub unsafe fn flush_3a( &self, region: impl CastInto<Ref<QRegion>>, window: impl CastInto<Ptr<QWindow>>, offset: impl CastInto<Ref<QPoint>> )

Flushes the given region from the specified window win onto the screen.

Calls C++ function: void QBackingStore::flush(const QRegion& region, QWindow* window = …, const QPoint& offset = …).

C++ documentation:

Flushes the given region from the specified window win onto the screen.

Note that the offset parameter is currently unused.

source

pub unsafe fn flush_2a( &self, region: impl CastInto<Ref<QRegion>>, window: impl CastInto<Ptr<QWindow>> )

Flushes the given region from the specified window win onto the screen.

Calls C++ function: void QBackingStore::flush(const QRegion& region, QWindow* window = …).

C++ documentation:

Flushes the given region from the specified window win onto the screen.

Note that the offset parameter is currently unused.

source

pub unsafe fn flush_1a(&self, region: impl CastInto<Ref<QRegion>>)

Flushes the given region from the specified window win onto the screen.

Calls C++ function: void QBackingStore::flush(const QRegion& region).

C++ documentation:

Flushes the given region from the specified window win onto the screen.

Note that the offset parameter is currently unused.

source

pub unsafe fn has_static_contents(&self) -> bool

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

Calls C++ function: bool QBackingStore::hasStaticContents() const.

C++ documentation:

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

source

pub unsafe fn new(window: impl CastInto<Ptr<QWindow>>) -> CppBox<QBackingStore>

Constructs an empty surface for the given top-level window.

Calls C++ function: [constructor] void QBackingStore::QBackingStore(QWindow* window).

C++ documentation:

Constructs an empty surface for the given top-level window.

source

pub unsafe fn paint_device(&self) -> Ptr<QPaintDevice>

Implement this function to return the appropriate paint device.

Calls C++ function: QPaintDevice* QBackingStore::paintDevice().

C++ documentation:

Implement this function to return the appropriate paint device.

source

pub unsafe fn resize(&self, size: impl CastInto<Ref<QSize>>)

Sets the size of the windowsurface to be size.

Calls C++ function: void QBackingStore::resize(const QSize& size).

C++ documentation:

Sets the size of the windowsurface to be size.

See also size().

source

pub unsafe fn scroll( &self, area: impl CastInto<Ref<QRegion>>, dx: c_int, dy: c_int ) -> bool

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

Calls C++ function: bool QBackingStore::scroll(const QRegion& area, int dx, int dy).

C++ documentation:

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.

source

pub unsafe fn set_static_contents(&self, region: impl CastInto<Ref<QRegion>>)

Set region as the static contents of this window.

Calls C++ function: void QBackingStore::setStaticContents(const QRegion& region).

C++ documentation:

Set region as the static contents of this window.

See also staticContents().

source

pub unsafe fn size(&self) -> CppBox<QSize>

Returns the current size of the windowsurface.

Calls C++ function: QSize QBackingStore::size() const.

C++ documentation:

Returns the current size of the windowsurface.

source

pub unsafe fn static_contents(&self) -> CppBox<QRegion>

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

Calls C++ function: QRegion QBackingStore::staticContents() const.

C++ documentation:

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

See also setStaticContents().

source

pub unsafe fn window(&self) -> QPtr<QWindow>

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

Calls C++ function: QWindow* QBackingStore::window() const.

C++ documentation:

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

Trait Implementations§

source§

impl CppDeletable for QBackingStore

source§

unsafe fn delete(&self)

Destroys this surface.

Calls C++ function: [destructor] void QBackingStore::~QBackingStore().

C++ documentation:

Destroys this surface.

source§

impl Size for QBackingStore

source§

unsafe fn size(&self) -> usize

Returns the current size of the windowsurface.

Calls C++ function: QSize QBackingStore::size() const.

C++ documentation:

Returns the current size of the windowsurface.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.