Clarify Q_INIT_RESOURCE in relation to namespaces

The constructor functions generated by rcc are put in the global namespace.
As there is no way to forward-declare a function in the global namespace
from within another namespace, Q_INIT_RESOURCE must always be called from
the global namespace.

Change-Id: I8b8b9451271cf2f9147164696a6df7615678ab03
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
This commit is contained in:
Tor Arne Vestbø 2013-11-05 14:07:43 +01:00 committed by The Qt Project
parent 762c3d87de
commit 8f77f9536f

View File

@ -198,6 +198,10 @@
clients of your library will only link in the resources if they use
the feature of the library that depends on them.
Note: As the resource initializers generated by rcc are declared in the
global namespace, your calls to \l Q_INIT_RESOURCE() also need to be done
outside of any namespace.
If the library includes resources that are not used internally, but
instead exposed to clients of the library, the initialization needs
to happen in the application code. For example: