From 8f77f9536fc31fe9e4ac032845ff168c7ca41ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 5 Nov 2013 14:07:43 +0100 Subject: 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 --- src/corelib/doc/src/resource-system.qdoc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/corelib/doc/src/resource-system.qdoc b/src/corelib/doc/src/resource-system.qdoc index 4c24320851..91ce8afcf8 100644 --- a/src/corelib/doc/src/resource-system.qdoc +++ b/src/corelib/doc/src/resource-system.qdoc @@ -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: -- cgit v1.2.3