本页内容

point QML Value Type

一个具有 x 和 y 属性的值。更多...

Import Statement: import QtQml

详细描述

point 类型指具有x 和y 属性的值。

要创建一个point 值,请将其指定为“x,y”字符串:

CustomObject { myPointProperty: "0,20" }

或者使用Qt.point() 函数:

CustomObject { myPointProperty: Qt.point(0, 20) }

在与 C++ 集成时,请注意:从 C++ 传递到 QML 的任何QPoint 或QPointF 值都会自动转换为point 值。当point 值传递给 C++ 时,它会自动转换为QPointF 值。

类型为point 的属性默认是Qt.point(0, 0) 。

另请参阅 QML 值类型。

© 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.