On quarta-feira, 4 de setembro de 2013 18:23:17, arno wrote:
> void LongRunning::run() {
>    //mydb is set up in a singleton
>    QSqlDatabase db = QSqlDatabase::cloneDatabase("mydb", uniquesting);
>    ... select something from database...
>    End of LongRunning:
>    QSqlDatabase::removeDatabase(uniquestring);
> }
> 
> LongRunning is managed by a QThreadPool. I'm looking for a way to
> generate a unique "uniquestring" for each connection.

Is that the global thread pool, or one of yours? If it's the global pool, it's 
a problem, since you should only run short tasks there.

In any case, the pointer address might be reused, but only after 
removeDatabase. So there's no conflict.

> I tried QUuid, but the documentation is scarce. Seems it's only a class
> for representing a UUID, not for generating one, right?

Hmm... the docs say 
"Most platforms provide a tool for generating new UUIDs, e.g. uuidgen and 
guidgen. You can also use createUuid(). "

But the QUuid::createUuid function is not documented. It exists, it's just not 
documented. Looks like an oversight.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to