Scale QML Type

提供一种缩放项的方法。更多

Import Statement: import QtQuick

属性

详细说明

缩放类型提供了一种通过缩放类型变换缩放Item 的方法。

它允许 x 轴和 y 轴使用不同的缩放值,并允许相对于任意点进行缩放。与scale 属性相比,它能提供更多的项目缩放控制。

下面的示例是相对于内部点(25,25)缩放矩形的 X 轴:

Rectangle {
    width: 100; height: 100
    color: "blue"
    transform: Scale { origin.x: 25; origin.y: 25; xScale: 3}
}

另请参阅 RotationTranslate

属性文档

origin group

origin.x : real

origin.y : real

该属性用于保存项目缩放时的原点(即在项目其余部分增长时相对于父对象保持固定的点)。

原点的默认值为(0,0)。


xScale : real

X 轴的缩放因子。

默认值为 1.0。


yScale : real

Y 轴的缩放因子。

默认值为 1.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.