效果如下: 代码如下: import QtQuick 2.0 import QtQuick.Controls 2.0 Rectangle { visible: true width: 600 height: 600 Canvas{ id:canvas width: 300 height: 300 anchors.centerIn: parent property int j: 0 onPaint: { var ctx = getContext