a little better : I changed for that
Code:
while( nb_val < MAX_KEYS_NB)
{
//RandomValue = Randomize( 0, MAX_KEYS_NB ); // Get random value between 0-10
RandomValue = qrand()%10 ;
Keys_Set.insert(RandomValue) ;
nb_val = Keys_Set.count() ;
}
and later in the generate keys method :
Code:
QTime time = QTime::currentTime() ; // Create seed for the random that is needed only once on startup
//qsrand(QDateTime::currentDateTime ().toTime_t ());
qsrand((uint)time.msec()) ;
Scrambled_Keyb_Set = this->RandomKeys () ;
QList<int> list = Scrambled_Keyb_Set.toList();
I moved the qsrand so that it initialize only on the QPushbutton event that is far to the mS.
You say there are ten values, but what are they?
an ordered set only, and always