Create a random string or number in Qt4

defiant picture defiant · Jul 14, 2010 · Viewed 47.1k times · Source

Is there any function or something like that by which I can create totally random strings or numbers?

Answer

user362638 picture user362638 · Jul 14, 2010

You can create random numbers using qrand. If you need strings, you can convert the int to string. You could also check the QUuid class, which generates Universally Unique Identifiers. Those are not 'totally random', but they are unique.