Struct rute::auto::backing_store::BackingStore
source · pub struct BackingStore<'a> { /* private fields */ }
Expand description
Notice these docs are heavy WIP and not very relevent yet
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
Licence
The documentation is an adoption of the original Qt Documentation and provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.
Implementations
sourceimpl<'a> BackingStore<'a>
impl<'a> BackingStore<'a>
sourcepub fn flush<P: PointTrait<'a>, R: RegionTrait<'a>, W: WindowTrait<'a>>(
&self,
region: &R,
window: &W,
offset: &P
) -> &Self
pub fn flush<P: PointTrait<'a>, R: RegionTrait<'a>, W: WindowTrait<'a>>(
&self,
region: &R,
window: &W,
offset: &P
) -> &Self
Returns a pointer to the top-level window associated with this surface.
Returns the paint device for this surface.
Warning: The device is only valid between calls to beginPaint() and endPaint(). You should not cache the returned value.
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().
See also: [Window::transient_parent
]
sourcepub fn resize<S: SizeTrait<'a>>(&self, size: &S) -> &Self
pub fn resize<S: SizeTrait<'a>>(&self, size: &S) -> &Self
Sets the size of the window surface to size.
See also: [size()
]
sourcepub fn scroll<R: RegionTrait<'a>>(&self, area: &R, dx: i32, dy: i32) -> bool
pub fn scroll<R: RegionTrait<'a>>(&self, area: &R, dx: i32, dy: i32) -> bool
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.
sourcepub fn begin_paint<R: RegionTrait<'a>>(&self, arg0: &R) -> &Self
pub fn begin_paint<R: RegionTrait<'a>>(&self, arg0: &R) -> &Self
Begins painting on the backing store surface in the given region.
You should call this function before using the paintDevice() to paint.
See also: [end_paint()
]
[paint_device()
]
sourcepub fn end_paint(&self) -> &Self
pub fn end_paint(&self) -> &Self
Ends painting.
You should call this function after painting with the paintDevice() has ended.
See also: [begin_paint()
]
[paint_device()
]
sourcepub fn set_static_contents<R: RegionTrait<'a>>(&self, region: &R) -> &Self
pub fn set_static_contents<R: RegionTrait<'a>>(&self, region: &R) -> &Self
Set region as the static contents of this window.
sourcepub fn static_contents(&self) -> Region<'_>
pub fn static_contents(&self) -> Region<'_>
Returns a QRegion representing the area of the window that has static contents.
sourcepub fn has_static_contents(&self) -> bool
pub fn has_static_contents(&self) -> bool
Returns a boolean indicating if this window has static contents or not.
Trait Implementations
sourceimpl<'a> Clone for BackingStore<'a>
impl<'a> Clone for BackingStore<'a>
sourcefn clone(&self) -> BackingStore<'a>
fn clone(&self) -> BackingStore<'a>
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more