On this page

C

Platform Migration Guide to Qt for MCUs 3.0

Here are the changes to be aware of when porting a platform or an application from Qt for MCUs 2.x to Qt for MCUs 3.0 or higher.

Application-owned main loop

The application now always owns the Qt Quick Ultralite main loop. It calls Application::update() to run the Qt Quick Ultralite engine and passes the returned timestamp to Application::waitUntil():

while (true) {
    uint64_t nextUpdate = app.update();
    app.waitUntil(nextUpdate);
}

Qul::Application::exec() is removed. Replace calls to it with this loop.

See Running Qt Quick Ultralite in applications for more information.

Removed platform APIs

Removed APIReplacement
Qul::Platform::PlatformContext::exec()No direct replacement. The application owns the loop.
Qul::Platform::PlatformContext::update()Move periodic platform work to PlatformContext::process(). Application::update() routes the update directly.
Qul::Platform::PlatformContext::scheduleEngineUpdate(uint64_t)For timer-based updates, use the timestamp returned by Application::update(). For interrupts and events, call PlatformContext::resume().
Qul::PlatformInterface::updateEngine(uint64_t)Call Application::update() from the application's loop. To wake the loop from an interrupt service routine, such as a hardware timer, call PlatformContext::resume().

Removed C API

qul_app_exec() is removed. Replace it with the loop that uses the functions declared in qul_run.h:

while (true) {
    uint64_t nextUpdate = qul_update_engine();
    qul_wait_until(nextUpdate);
}

Waiting and resuming

Implement PlatformContext::waitUntil() and PlatformContext::resume() in the platform to suspend between updates and to wake up early. See Waiting for the next update for details.

Available under certain Qt licenses.
Find out more.