En esta página

Translate QML Type

Permite mover un elemento sin cambiar sus propiedades x o y. Más...

Import Statement: import QtQuick

Propiedades

  • x : real
  • y : real

Descripción detallada

El tipo Translate proporciona un control independiente sobre la posición, además de las propiedades x e y del elemento.

El siguiente ejemplo desplaza el eje Y de los elementos de Rectangle al tiempo que permite a Row disponer los elementos como si no se hubieran transformado:

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

Documentación de propiedades

x : real

La traslación a lo largo del eje X.

El valor por defecto es 0.0.

y : real

La traslación a lo largo del eje Y.

El valor por defecto es 0.0.

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