Search code examples
qtqt4random

Create a random string or number in Qt4


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


Solution

  • 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.