Scale QML Type
提供了一种调整项大小的方法。更多...
| Import Statement: | import QtQuick |
属性
详细说明
Scale 类型提供了一种通过缩放变换对Item 进行缩放的方法。
它允许为 x 轴和 y 轴设置不同的缩放值,并支持以任意点为基准进行缩放。与 `scale ` 属性相比,这能提供对项目缩放的更精细控制。
以下示例以矩形内部点 (25, 25) 为基准,对矩形的 X 轴进行缩放:
Rectangle {
width: 100; height: 100
color: "blue"
transform: Scale { origin.x: 25; origin.y: 25; xScale: 3}
}属性文档
origin group
该属性表示项目进行缩放时的锚点(即当项目其余部分扩大时,相对于父级保持固定的点)。
原点的默认值为 (0, 0)。
xScale : real
X 轴的缩放因子。
默认值为 1.0。
yScale : real
Y轴的缩放因子。
默认值为 1.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.