代码如下: [cpp] view plain copy #include <QUuid> QUuid id = QUuid::createUuid(); QString strId = id.toString();