Translate QML Type

Provides a way to move an Item without changing its x or y properties. More...

Import Statement: import QtQuick

Properties

  • x : real
  • y : real

Detailed Description

The Translate type provides independent control over position in addition to the Item's x and y properties.

The following example moves the Y axis of the Rectangle items while still allowing the Row to lay the items out as if they had not been transformed:

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 }
    }
}

Property Documentation

x : real

The translation along the X axis.

The default value is 0.0.


y : real

The translation along the Y axis.

The default value is 0.0.


© 2023 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.