Fix static plugins for classes in namespaces.
Breakage introduced by 819d0203e6
.
Extend QT_MOC_EXPORT to take the unqualified class name
as well for the function names.
Change-Id: I736097b564caa37c522d723780663d03341f9032
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Lukas Geyer <lgeyer@gmx.at>
This commit is contained in:
parent
1cebd906af
commit
861786bb50
@ -107,18 +107,18 @@ void Q_CORE_EXPORT qRegisterStaticPluginFunction(QStaticPlugin staticPlugin);
|
||||
|
||||
#if defined(QT_STATICPLUGIN)
|
||||
|
||||
# define QT_MOC_EXPORT_PLUGIN(PLUGINCLASS) \
|
||||
static QT_PREPEND_NAMESPACE(QObject) *qt_plugin_instance_##PLUGINCLASS() \
|
||||
# define QT_MOC_EXPORT_PLUGIN(PLUGINCLASS, PLUGINCLASSNAME) \
|
||||
static QT_PREPEND_NAMESPACE(QObject) *qt_plugin_instance_##PLUGINCLASSNAME() \
|
||||
Q_PLUGIN_INSTANCE(PLUGINCLASS) \
|
||||
static const char *qt_plugin_query_metadata_##PLUGINCLASS() { return (const char *)qt_pluginMetaData; } \
|
||||
const QT_PREPEND_NAMESPACE(QStaticPlugin) qt_static_plugin_##PLUGINCLASS() { \
|
||||
QT_PREPEND_NAMESPACE(QStaticPlugin) plugin = { qt_plugin_instance_##PLUGINCLASS, qt_plugin_query_metadata_##PLUGINCLASS}; \
|
||||
static const char *qt_plugin_query_metadata_##PLUGINCLASSNAME() { return (const char *)qt_pluginMetaData; } \
|
||||
const QT_PREPEND_NAMESPACE(QStaticPlugin) qt_static_plugin_##PLUGINCLASSNAME() { \
|
||||
QT_PREPEND_NAMESPACE(QStaticPlugin) plugin = { qt_plugin_instance_##PLUGINCLASSNAME, qt_plugin_query_metadata_##PLUGINCLASSNAME}; \
|
||||
return plugin; \
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
# define QT_MOC_EXPORT_PLUGIN(PLUGINCLASS) \
|
||||
# define QT_MOC_EXPORT_PLUGIN(PLUGINCLASS, PLUGINCLASSNAME) \
|
||||
Q_EXTERN_C Q_DECL_EXPORT \
|
||||
const char *qt_plugin_query_metadata() \
|
||||
{ return (const char *)qt_pluginMetaData; } \
|
||||
|
@ -1452,7 +1452,8 @@ void Generator::generatePluginMetaData()
|
||||
int pos = cdef->qualified.indexOf("::");
|
||||
for ( ; pos != -1 ; pos = cdef->qualified.indexOf("::", pos + 2) )
|
||||
fprintf(out, "using namespace %s;\n", cdef->qualified.left(pos).constData());
|
||||
fprintf(out, "QT_MOC_EXPORT_PLUGIN(%s)\n\n", cdef->qualified.constData());
|
||||
fprintf(out, "QT_MOC_EXPORT_PLUGIN(%s, %s)\n\n",
|
||||
cdef->qualified.constData(), cdef->classname.constData());
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
Loading…
Reference in New Issue
Block a user