From 629f5a46d531886cebe654a4ddb9269b62874e6a Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 11 May 2015 13:11:59 +0200 Subject: moc: Generate qt_static_metacall for creatable-only gadgets Prior to this, moc would not generate the function unless the gadget class had a property or a non-constructor invokable. Change-Id: Ic020ea5f8f59702f5e9e194a46e26850e53e5cfe Reviewed-by: Simon Hausmann Reviewed-by: Olivier Goffart (Woboq GmbH) --- tests/auto/tools/moc/tst_moc.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 7fa5de3377..8bef678af9 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -90,13 +90,15 @@ struct QTBUG_31218_Derived : QTBUG_31218<-1<0> {}; class CreatableGadget { Q_GADGET - Q_PROPERTY(int a MEMBER a) public: - Q_INVOKABLE CreatableGadget() : a(0xdeadbeef) { } - - int a; + Q_INVOKABLE CreatableGadget() + { + CreatableGadget::qt_static_metacall((QObject*)this, QMetaObject::ReadProperty, -1, Q_NULLPTR); + } }; +CreatableGadget creatableGadget; // Force the compiler to use the constructor + struct MyStruct {}; struct MyStruct2 {}; -- cgit v1.2.3