summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp10
1 files changed, 6 insertions, 4 deletions
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 {};