[−][src]Struct qt_qml::QQmlIncubationController
In order to behave asynchronously and not introduce stutters or freezes in an application, the process of creating objects a QQmlIncubators must be driven only during the application's idle time. QQmlIncubationController allows the application to control exactly when, how often and for how long this processing occurs.
C++ class: QQmlIncubationController
.
In order to behave asynchronously and not introduce stutters or freezes in an application, the process of creating objects a QQmlIncubators must be driven only during the application's idle time. QQmlIncubationController allows the application to control exactly when, how often and for how long this processing occurs.
A QQmlIncubationController derived instance should be created and set on a QQmlEngine by calling the QQmlEngine::setIncubationController() method. Processing is then controlled by calling the QQmlIncubationController::incubateFor() or QQmlIncubationController::incubateWhile() methods as dictated by the application's requirements.
For example, this is an example of a incubation controller that will incubate for a maximum of 5 milliseconds out of every 16 milliseconds.
class PeriodicIncubationController : public QObject, public QQmlIncubationController { public: PeriodicIncubationController() { startTimer(16); }
protected: void timerEvent(QTimerEvent *) override { incubateFor(5); } };
Although the previous example would work, it is not optimal. Real world incubation controllers should try and maximize the amount of idle time they consume - rather than a static amount like 5 milliseconds - while not disturbing the application.
Methods
impl QQmlIncubationController
[src]
pub unsafe fn engine(&self) -> QPtr<QQmlEngine>
[src]
Return the QQmlEngine this incubation controller is set on, or 0 if it has not been set on any engine.
Calls C++ function: QQmlEngine* QQmlIncubationController::engine() const
.
Return the QQmlEngine this incubation controller is set on, or 0 if it has not been set on any engine.
pub unsafe fn incubate_for(&self, msecs: c_int)
[src]
Incubate objects for msecs, or until there are no more objects to incubate.
Calls C++ function: void QQmlIncubationController::incubateFor(int msecs)
.
Incubate objects for msecs, or until there are no more objects to incubate.
pub unsafe fn incubating_object_count(&self) -> c_int
[src]
Return the number of objects currently incubating.
Calls C++ function: int QQmlIncubationController::incubatingObjectCount() const
.
Return the number of objects currently incubating.
pub unsafe fn new() -> CppBox<QQmlIncubationController>
[src]
Create a new incubation controller.
Calls C++ function: [constructor] void QQmlIncubationController::QQmlIncubationController()
.
Create a new incubation controller.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for QQmlIncubationController
impl Send for QQmlIncubationController
impl Sync for QQmlIncubationController
impl Unpin for QQmlIncubationController
impl UnwindSafe for QQmlIncubationController
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> CastInto<U> for T where
U: CastFrom<T>,
[src]
U: CastFrom<T>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> StaticUpcast<T> for T
[src]
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,