Translate Element Reference

The Translate object provides a way to move an Item without changing its x or y properties.

This element was introduced in Qt 4.7.

Detailed Description

The Translate object provides a way to move an Item without changing its x or y properties.

The Translate object 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 elements while still allowing the Row element to lay the items out as if they had not been transformed:

  1. import QtQuick 1.0
  2.  
  3. Row  {
  4.     Rectangle  {
  5.         width: 100; height: 100
  6.         color: "blue"
  7.         transform: Translate  { y: 20 }
  8.     }
  9.     Rectangle  {
  10.         width: 100; height: 100
  11.         color: "red"
  12.         transform: Translate  { y: -20 }
  13.     }
  14. }

Properties

  • x : real
  • y : real

Property Documentation

The translation along the X axis.

The translation along the Y axis.

Notes provided by the Qt Community

No notes