The code below shows the normal way to use the QCA::Random class.
#include <QtCrypto>
#include <QCoreApplication>
#include <QDebug>
#include <iostream>
#ifdef QT_STATICPLUGIN
#include "import_plugins.h"
#endif
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
qDebug() << "This example generates random numbers";
int randInt;
qDebug() << "A random number: " << randInt;
unsigned char randChar;
std::cout << "A random character: " << randChar << std::endl;
std::cout << "A random 10 byte array (in hex): ";
std::cout << qPrintable(
QCA::Hex().arrayToString(tenBytes)) << std::endl;
return 0;
}