Qt获取uuid

代码:

#include <QUuid>
 
QUuid id = QUuid::createUuid();
QString strId = id.toString();
qDebug() << strId;
//输出结果:"{b5eddbaf-984f-418e-88eb-cf0b8ff3e775}"
strId.remove("{").remove("}").remove("-"); // 一般习惯去掉左右花括号和连字符
qDebug() << strId;
//输出结果:"b5eddbaf984f418e88ebcf0b8ff3e775"

转自:https://blog.csdn.net/u014746838/article/details/78442680

posted @ 2021-11-29 11:39  朱小勇  阅读(1174)  评论(0编辑  收藏  举报