#include <QCoreApplication> #include <QUuid> #include <QDebug> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QUuid id = QUuid::createUuid(); QString strId = id.toString(); qDebug()<< strId; return a.exec(); }