Use Q_GLOBAL_STATIC where K_GLOBAL_STATIC is not needed?

Olivier Goffart ogoffart at
Wed Feb 9 23:25:12 GMT 2011

Le Wednesday 09 February 2011, Stephen Kelly a écrit :
> Thiago Macieira wrote:
> > Q_GLOBAL_STATIC is not public API. Don't use it.
> Would it be an option to make it public API by documenting it or is that
> out of the question?

I'm in favor of making it public API.
Make a merge request that document it and i'd merge it.
(Unless Thiago has valid objections)

The macro is in public headers and has been used in 3rd party code already, so 
we cannot remove it anyway.  So i'd say use it :-)


(Notice that one of the danger that need to be documented is that, if run in 
multiple thread, the object may be created from any thread. and if two thread 
creates the object in the same time, two objects will be created (and one will 
be destroyed).  So the constructors of those objects need to be reentrant.)

More information about the kde-core-devel mailing list