PyQt/partner_625781186/QML_QtQuick_PY/python_QML调用基础/4-Python调用QML函数/test4.qml
2018-04-16 23:17:02 +08:00

24 lines
No EOL
472 B
QML

import QtQuick 2.0
Rectangle {
id: page
width: 500; height: 200
color: "lightgray"
function updateRotater() {// 定义函数
rotater.angle += 5
}
Rectangle {
id: rotater
property real angle : 0
x: 240; y: 95
width: 100; height: 5
color: "black"
transform: Rotation {
origin.x: 10; origin.y: 5
angle: rotater.angle
}
}
}