Do not unconditionally define QT_BEGIN_MOC_NAMESPACE
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>
Fri, 30 Dec 2011 13:18:28 +0000 (14:18 +0100)
committerQt by Nokia <qt-info@nokia.com>
Mon, 2 Jan 2012 12:33:11 +0000 (13:33 +0100)
commit5a3b08e994b9120a370123d1a8d96f28216eaeca
tree762c8bdf23a72a03dee01658eca4fb2147ed03d4
parent8cb0ef0793c292d546acabc813d8af6a026dc7bf
Do not unconditionally define QT_BEGIN_MOC_NAMESPACE

Qt5 modules are supposed to be in a namespace, but if the namespace definition
is hidden in a macro, then moc doesn't know about it and generates invalid
moc_xx.cpp that cannot be compiled due to usage of classes outside of their
namespaces - e.g. in qtjsondb we have QtAddOn::JsonDb::Foo class, but the
moc_foo.cpp expects to find that class in the global namespace instead.

Fixed it in QtJsonDb to define QT_BEGIN_MOC_NAMESPACE="QT_USE_NAMESPACE
QT_ADDON_JSONDB_USE_NAMESPACE", however we need to ensure qglobal.h doesn't
re-define that macro back.

Change-Id: Ic8407f50c11d2d787167ad2f92457aa3ec126d45
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
src/corelib/global/qglobal.h