このページでは

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( pos) constQul::PlatformInterface::Point
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

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

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() 関数を使用して、これらのプラットフォーム固有の関数にアクセスします。詳細については、PlatformContext およびQt Quick Ultralite Platform Porting Guide を参照してください。

以下に、PlatformContext の使用例とQt for MCUs 1.9との比較を示します。

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

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