このページでは

C

C++ API の変更

削除されたC++関数

前バージョンのQt for MCUs で非推奨とされていた関数は、v2.0 ですべて削除された。以下の表に、これらの関数とその代替関数を示します。

削除代替関数
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_tQul::PlatformInterface::DrawingDevice::bitsPerPixel() const
int8_t Qul::PlatformInterface::Texture::bytesPerPixel() constint8_tQul::PlatformInterface::Texture::bitsPerPixel() const
int Qul::Image::bytesPerPixel() constint Qul::Image::bitsPerPixel() const
Qul::Application::setUiLanguage()Qul::ApplicationSettings

次の例は、アプリケーションのUI言語が、1.9と比較してQt for MCUs 2.0でどのように設定できるかを示しています。

Qt for MCUs v1.9以前
Qul::Application app;
app.setUiLanguage("pl_PL");
Qt for MCUs v2.0以降
Qul::Application app;
app.settings().uiLanguage.setValue("pl_PL");

変更されたC++ API

Qul::Platform 名前空間

Qt for MCUs 2.0以降、以前はQul::Platform 名前空間で定義されていた関数は、新しいPlatformContext 構造体に移動されます。プラットフォーム実装はこの新しい構造を継承し、その仮想関数をオーバーライドします。 Qt Quick Ultraliteコアは、Qul::Platform::getPlatformInstance()関数を使用して、これらのプラットフォーム固有の関数にアクセスします。詳細はPlatformContextQt Quick Ultralite Platform Porting Guide を参照してください。

Qt for MCUs 1.9と比較したPlatformContext の使用例を示します:

Qt for MCUs v1.9以前Qt for MCUs v2.0以降
auto now = Qul::Platform::currentTimestamp();
auto now = Qul::Platform::getPlatformInstance()->currentTimestamp();

特定の Qt ライセンスの下で利用可能です。
詳細はこちら。