头文件
#include <QRandomGenerator>
通过使用QRandomGenerator类的global函数调用bounded生成随机数
double bounded(double highest) 0 ~ highest-1
quint32 bounded(quint32 highest) 0 ~ highest-1
quint32 bounded(quint32 lowest, quint32 highest) lowest ~ highest-1
int bounded(int highest) 0 ~ highest-1
int bounded(int lowest, int highest) lowest ~ highest-1
int num = QRandomGenerator::global()->bounded(m_cards.size());
Qt 生成随机数
最新推荐文章于 2025-04-22 15:52:50 发布

1360

被折叠的 条评论
为什么被折叠?



