Translate QML Type
Bietet eine Möglichkeit, ein Element zu verschieben, ohne dessen x- oder y-Eigenschaften zu ändern. Mehr...
| Import Statement: | import QtQuick |
Eigenschaften
Ausführliche Beschreibung
Der Typ „Translate“ ermöglicht zusätzlich zu den x- und y-Eigenschaften des Elements eine unabhängige Steuerung der Position.
Im folgenden Beispiel wird die Y-Achse der „ Rectangle “-Elemente verschoben, während die „ Row “ die Elemente weiterhin so anordnet, als wären sie nicht transformiert worden:
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 }
}
}
Eigenschaftsdokumentation
x : real
Die Verschiebung entlang der X-Achse.
Der Standardwert ist 0,0.
y : real
Die Verschiebung entlang der Y-Achse.
Der Standardwert ist 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.