Use qualified name for QT_MOC_EXPORT_PLUGIN()
Using non-qualified name for QT_MOC_EXPORT_PLUGIN() breaks template
instatiation for QPointer<T>::operator=(T*) in qt_plugin_instance()
when the class is embedded a namespace with the same name.
namespace Test {
class Test : public QObject
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "Test")
public:
Test(QObject *parent = 0) : QObject(parent) {}
};
} // namespace Test
In function 'QObject* qt_plugin_instance()':
error: expected type-specifier before 'Test'
error: no match for 'operator=' in
'_instance = (int*)operator new(4u)'
note: candidates are:
In file included from qtbase\include\QtCore/qpointer.h:1:0,
from qtbase\include\QtCore/QtCore:68,
from test.cpp:1:
qtbase/src/corelib/kernel/qpointer.h:87:25:
note: QPointer<T>& QPointer<T>::operator=(T*) [with T = QObject]
qtbase/src/corelib/kernel/qpointer.h:87:25:
note: no known conversion for argument 1
from 'int*' to 'QObject*'
qtbase/src/corelib/kernel/qpointer.h:79:7:
note: QPointer<QObject>&
QPointer<QObject>::operator=(const QPointer<QObject>&)
qtbase/src/corelib/kernel/qpointer.h:79:7:
note: no known conversion for argument 1
from 'int*' to 'const QPointer<QObject>&'
error: expected ';' before 'Test'
Change-Id: Idd3e57ab1c888352ad2a8e8f6efca75d858089df
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
bb10
parent
9f561f8a41
commit
819d0203e6
|
|
@ -1452,7 +1452,7 @@ 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->classname.constData());
|
||||
fprintf(out, "QT_MOC_EXPORT_PLUGIN(%s)\n\n", cdef->qualified.constData());
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
Loading…
Reference in New Issue