diff options
author | Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> | 2015-05-11 12:52:34 +0200 |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> | 2015-05-13 12:08:54 +0000 |
commit | d6efc6b543d1a8fe2e1232750a98e396db07be0f (patch) | |
tree | f5a71f98a2c5e78814f9e293ded8a19d57c57a8a /src/tools/moc/generator.cpp | |
parent | a4d66348d64368bfae10662a1f11a4e40eca8ae2 (diff) |
moc: Fix type for gadget's CreateInstance metacall
An error similar to the one below would be emitted
by the compiler on the moc generated file:
error: assigning to 'QObject *' from incompatible type 'Gadget *'
if (_a[0]) *reinterpret_cast<QObject**>(_a[0]) = _r; } break;
Change-Id: I75ae7bd6c46d20db2d47a80eaa08aae302d7d6c8
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/tools/moc/generator.cpp')
-rw-r--r-- | src/tools/moc/generator.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index 8b6a0519c5..3b00e21208 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -1125,7 +1125,8 @@ void Generator::generateStaticMetacall() fprintf(out, "%s", QByteArray("QPrivateSignal()").constData()); } fprintf(out, ");\n"); - fprintf(out, " if (_a[0]) *reinterpret_cast<QObject**>(_a[0]) = _r; } break;\n"); + fprintf(out, " if (_a[0]) *reinterpret_cast<%s**>(_a[0]) = _r; } break;\n", + cdef->hasQGadget ? "void" : "QObject"); } fprintf(out, " default: break;\n"); fprintf(out, " }\n"); |