#include<QTime> 首先调用函数 qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); 产生一个进程 然后调用函数 n = qrand(); n就是所差生的随机数