Translate QML Type

アイテムの x や y のプロパティを変更せずにアイテムを移動する方法を提供します。詳細...

Import Statement: import QtQuick

プロパティ

  • x : real
  • y : real

詳細説明

Translateタイプは、Itemのxおよびyプロパティに加えて、位置に対する独立した制御を提供する。

次の例では、Rectangle アイテムの Y 軸を移動する一方で、Row アイテムを変換されていないかのようにレイアウトすることができます:

import QtQuick 2.0

Row {
    Rectangle {
        width: 100; height: 100
        color: "blue"
        transform: Translate { y: 20 }
    }
    Rectangle {
        width: 100; height: 100
        color: "red"
        transform: Translate { y: -20 }
    }
}

プロパティの説明

x : real

X軸の移動量。

デフォルト値は 0.0 です。


y : real

Y 軸に沿った平行移動。

デフォルト値は 0.0。


© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.