このページでは

C

QML APIの変更点

削除された QML タイプおよび機能

以下に、削除された QML 型およびモジュールのリストを示します

QML API またはモジュール代替
Qt Charts モジュール代替となるものはありませんが、静的画像を用いた回避策を利用できます。サーモスタットのデモを参照してください。
JavaScript Date API現時点では代替手段はありません。
toFixedInt()toFixed()
toExponentialAuto()toExponential()

移動QulPerf

QulPerf は、Qt Quick のUltralite Extras QMLモジュールに移動されました。これを使用するには、Qt Quick のUltralite Extras QMLモジュールをインポートする必要があります。

Qt for MCUs v1.9 以前Qt for MCUs v2.0以降
import QtQuick 2.15
Row {
    id: root
    visible: QulPerf.enabled

    PerformanceMetricItem {
        label: "FPS:"
        value: QulPerf.fps.toFixed(2)
    }
}
import QtQuick 2.15
import QtQuickUltralite.Extras 2.0
Row {
    id: root
    visible: QulPerf.enabled

    PerformanceMetricItem {
        label: "FPS:"
        value: QulPerf.fps.toFixed(2)
    }
}

xml-ph-0000@deepl.internal 内のListElement

ListElement 内では、JavaScript式をプロパティ値にバインドできなくなりました。ListElement では、可能な値が定数およびqsTr()qsTrId() の呼び出しのみに制限されるようになりました。これらの変更はQt XMLと互換性があります。

Qt for MCUs v1.9 以前Qt for MCUs v2.0以降
ListModel {
    id: fruitModel

    ListElement {
        name: "Apple"
        cost: { 5 + 10 }
    }
    ListElement {
        name: "Orange"
        cost: 3.25
    }
}
ListModel {
    id: fruitModel

    ListElement {
        name: "Apple"
        cost: 15
    }
    ListElement {
        name: "Orange"
        cost: 3.25
    }
}

`Item`の余白はAnchorChanges

AnchorChanges は、アイテムの余白を変更するために使用できなくなりました。代わりにPropertyChanges を使用してください。

Qt for MCUs v1.9 以前Qt for MCUs v2.0 以降
AnchorChanges {
    target: myRect
    anchors {
        top: anchorRectEnd.top
        bottom: anchorRectEnd.bottom
        left: anchorRectEnd.left
        right: anchorRectEnd.right
        topMargin: 20
        bottomMargin: 20
        leftMargin: 20
        rightMargin: 20
    }
}
AnchorChanges {
    target: myRectanchors {
        top: anchorRectEnd.top
        bottom: anchorRectEnd.bottom
        left: anchorRectEnd.left
        right: anchorRectEnd.right
    }
}
PropertyChanges {
    target: myRect
    anchors {
        topMargin: 20
        bottomMargin: 20
        leftMargin: 20
        rightMargin: 20
    }
}

テキストの配置

`horizontalAlignment ` および `verticalAlignment ` プロパティの列挙値が、Text およびStaticText アイテムの両方で統一されました。これらのタイプでは、代わりに `Text.horizontalAlignment ` および `Text.verticalAlignment ` の値が使用されるようになりました。

Qt for MCUs v1.9 以前Qt for MCUs v2.0以降
StaticText {
    horizontalAlignment: StaticText.AlignRight
    verticalAlignment: StaticText.AlignVCenter
    text: "right aligned"
}
StaticText {
    horizontalAlignment: Text.AlignRight
    verticalAlignment: Text.AlignVCenter
    text: "right aligned"
}

Font.unicodeCoverage の使用制限

font.unicodeCoverage プロパティは、Qt.font() コンテキストでのみサポートされています。

Qt for MCUs v1.9 以前Qt for MCUs v2.0 以降
Text {
    font.unicodeCoverage: [Font.UnicodeBlock_BasicLatin]
}
Text {
    font: Qt.font({ unicodeCoverage: [Font.UnicodeBlock_BasicLatin]})
}

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