Random number or random string with qt
General and Desktop
2
Posts
2
Posters
4.0k
Views
1
Watching
-
Hi
There is big difference between a random string and just a random number?
Anyway, fast way is justQString MyNum;
int rVal=rand()%1000;
MyNum = QString::number( rVal ) ;If you want truly unique ID, you can use
http://doc.qt.io/qt-5/quuid.html#detailsSo solution also depends on how many you will generate and
how unique it must be. Also over time.