C
QML API の変更
削除されたQMLの型と機能
以下は削除された QML タイプとモジュールのリストです。
| QML API またはモジュール | 代替 |
|---|---|
| Qt Charts モジュール | 代替モジュールはありませんが、静止画像を使った回避策があります。サーモスタットのデモを参照してください。 |
| JavaScript日付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) } } |
JavaScript式がListElement
JavaScript式は、ListElement のプロパティ値とバインドできなくなりました。ListElement は、使用可能な値を定数とqsTr() /qsTrId() 呼び出しのみに制限するようになりました。これらの変更は Qt と互換性があります。
| 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
}
} |
の項目マージン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 ライセンスの下で利用可能です。
詳細はこちら。