C

C++ API changes

Removed C++ functions

All functions that were deprecated in the previous version of Qt for MCUs, are removed in v2.0. The following table lists these functions and their alternatives.

RemovedAlternative
uchar *DrawingDevice::pixelAt(int32_t x, int32_t y) constQul::PlatformInterface::PixelDataPointer DrawingDevice::pixelDataAt(int32_t x, int32_t y)
uchar *DrawingDevice::pixelAt(Qul::PlatformInterface::Point pos) constQul::PlatformInterface::PixelDataPointer DrawingDevice::pixelDataAt(Qul::PlatformInterface::Point pos) const
Qul::PlatformInterface::Texture::dataAtOffset()Qul::PlatformInterface::PixelDataPointer Texture::pixelData(int16_t x, int16_t y) const
int32_t Qul::PlatformInterface::DrawingDevice::bytesPerPixel() constint32_t Qul::PlatformInterface::DrawingDevice::bitsPerPixel() const
int8_t Qul::PlatformInterface::Texture::bytesPerPixel() constint8_t Qul::PlatformInterface::Texture::bitsPerPixel() const
int Qul::Image::bytesPerPixel() constint Qul::Image::bitsPerPixel() const
Qul::Application::setUiLanguage()Qul::ApplicationSettings

The following example shows how the application's UI langauge can be set in Qt for MCUs 2.0 compared to 1.9.

Qt for MCUs v1.9 and earlier
Qul::Application app;
app.setUiLanguage("pl_PL");
Qt for MCUs v2.0 and later
Qul::Application app;
app.settings().uiLanguage.setValue("pl_PL");

Modified C++ APIs

Qul::Platform namespace

Since Qt for MCUs 2.0, functions that were previously defined in the Qul::Platform namespace, are moved to the new PlatformContext structure. The platform implementations inherit this new structure and override its virtual functions. Qt Quick Ultralite core accesses these platform-specific functions using the Qul::Platform::getPlatformInstance() function. For more information see PlatformContext and Qt Quick Ultralite Platform Porting Guide.

Here is an example of PlatformContext usage compared to Qt for MCUs 1.9:

Qt for MCUs v1.9 and earlierQt for MCUs v2.0 and later
auto now = Qul::Platform::currentTimestamp();
auto now = Qul::Platform::getPlatformInstance()->currentTimestamp();

Available under certain Qt licenses.
Find out more.