Translate QML Type
提供了一种在不改变项的 x 或 y 属性的情况下移动项的方法。更多
Import Statement: | import QtQuick |
属性
详细说明
除了项的 x 和 y 属性外,Translate 类型还提供了对位置的独立控制。
下面的示例移动了Rectangle 项目的 Y 轴,同时仍允许Row 像未转换一样布置项目:
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 } } }
属性文档
x : real |
沿 X 轴的平移量。
默认值为 0.0。
y : real |
沿 Y 轴的平移。
默认值为 0.0。
© 2025 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.