summaryrefslogtreecommitdiffstats
path: root/src/tools/moc
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-06-25 12:47:57 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-06-25 12:52:55 (GMT)
commitc938ec01a76bf56f667481e626fbb9252ee3d05d (patch)
tree063a742b510a71b1ed1ee6b3fc41a9288fe23273 /src/tools/moc
parent2d9aaff174d70953ed1f98c24baaf0c9abac78aa (diff)
downloadQt-c938ec01a76bf56f667481e626fbb9252ee3d05d.zip
Qt-c938ec01a76bf56f667481e626fbb9252ee3d05d.tar.gz
Qt-c938ec01a76bf56f667481e626fbb9252ee3d05d.tar.bz2
make invokable constructors work with classes in namespace
Use the fully qualified classname at relevant places in the moc-generated code. Also, QMetaObject::newInstance() needs to strip the namespace part, since the constructor signatures don't contain the fully qualified name. Task-number: 246064 Reviewed-by: Simon Hausmann
Diffstat (limited to 'src/tools/moc')
-rw-r--r--src/tools/moc/generator.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index 4814ecc..54305a3 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -918,7 +918,7 @@ void Generator::generateStaticMetacall(const QByteArray &prefix)
fprintf(out, " switch (_id) {\n");
for (int ctorindex = 0; ctorindex < cdef->constructorList.count(); ++ctorindex) {
fprintf(out, " case %d: { %s *_r = new %s(", ctorindex,
- cdef->classname.constData(), cdef->classname.constData());
+ cdef->qualified.constData(), cdef->qualified.constData());
const FunctionDef &f = cdef->constructorList.at(ctorindex);
int offset = 1;
for (int j = 0; j < f.arguments.count(); ++j) {
@@ -936,7 +936,7 @@ void Generator::generateStaticMetacall(const QByteArray &prefix)
fprintf(out, " }\n");
if (!isQObject)
- fprintf(out, " _id = %s::staticMetaObject.superClass()->static_metacall(_c, _id, _a);\n", cdef->classname.constData());
+ fprintf(out, " _id = %s::staticMetaObject.superClass()->static_metacall(_c, _id, _a);\n", cdef->qualified.constData());
fprintf(out, " if (_id < 0)\n return _id;\n");