views:

81

answers:

1

I stumbled about a method which seems to be present in all DataObjects like QList, QQueue, QHash...

I even investigated so far i can see the source code of it, which is

inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }

in qlist.h (lines 117)

but what effect does it have on the QList, QQueue, QHash... ? And is it in any way related to threading? (which sounds reasonable)

Thanks for any answer, and please only answer if you got actual knowledge.

+3  A: 

No one could say more clear:

http://qt.nokia.com/doc/4.6/implicit-sharing.html

It is common practice to realize containers this way.

Max
Though I search through the qt doc, I didn't stumble about that.. thanks very much
penguinpower