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 /tests | |
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 'tests')
-rw-r--r-- | tests/auto/tools/moc/tst_moc.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 405d273f4b..7fa5de3377 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -87,6 +87,16 @@ struct QTBUG_31218_Derived : QTBUG_31218<-1<0> {}; class QTBUG_45790 : Bug() { }; #endif +class CreatableGadget +{ + Q_GADGET + Q_PROPERTY(int a MEMBER a) +public: + Q_INVOKABLE CreatableGadget() : a(0xdeadbeef) { } + + int a; +}; + struct MyStruct {}; struct MyStruct2 {}; |