IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

Translate QML Type

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

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

Translate QML Type

  • Import Statement: import QtQuick

  • Group: Translate is part of qtquick-visual-transforms

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:

 
Sélectionnez
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 }
    }
}
Image non disponible

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.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+