I want to generate GUID in QT?
Can anyone tell me please how to generate it.
I went through the QUuid class but here we have to pass all the parameters to generate GUID.
@QUuid::createUuid ()@ static member
THanks for reply.
But this is not for windows,I want to do it in windows platform & at runtime i want to generate it.
So how to do that?
The documentation does not say that this functionality is windows-only, does it?
well i have to agree to andre. and i also use it on windows. so it works
If you just need to generate GUID's, there is a small tool "guidgen.exe" included with the Windows SDK.
And if you want to do it programmatically via Win32 API, instead of QUuid, you can use the CoCreateGuid().
Still I don't understand what is wrong with QUuid::createUuid() ???
I believe he was just thrown off by the way that is written in the documentation.
The first line of the QUuid::createUuid() is:
"On any platform other than Windows, this function returns a new UUID with variant QUuid::DCE and version QUuid::Random."
However, at the end it says that on Windows it will create a GUID, so you should be getting what you want with that.