1、QML

 rect.color = Qt.rgba(Math.random(), Math.random(), Math.random(), 1);//random返回0~1的随机数

 

2、Qt

QColor clr(rand() % 256, rand() % 256, rand() % 256);
qDebug()<<clr.name();

 

相关文章:

  • 2022-12-23
  • 2021-12-30
  • 2022-12-23
  • 2021-05-23
  • 2021-10-29
  • 2022-12-23
  • 2022-12-23
  • 2021-08-21
猜你喜欢
  • 2021-12-07
  • 2021-08-21
  • 2021-11-03
  • 2022-12-23
  • 2021-12-04
相关资源
相似解决方案