rect.color = Qt.rgba(Math.random(), Math.random(), Math.random(), 1);//random返回0~1的随机数
QML获取随机颜色
原文:https://www.cnblogs.com/judes/p/9429880.html