diff --git a/src/tools/moc/generator.h b/src/tools/moc/generator.h index 2d4d69ca05f..412e79e3146 100644 --- a/src/tools/moc/generator.h +++ b/src/tools/moc/generator.h @@ -21,7 +21,7 @@ public: const QHash &knownGadgets, FILE *outfile = nullptr, bool requireCompleteTypes = false); void generateCode(); - qsizetype registeredStringsCount() { return strings.size(); }; + qsizetype registeredStringsCount() { return strings.size(); } private: bool registerableMetaType(const QByteArray &propertyType); diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 84e4ed4200c..94ebef8aa1b 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -105,8 +105,6 @@ enum FooItems Q_ENUM_NS(FooItems) } -Q_DECLARE_METATYPE(const QMetaObject*); - #define TESTEXPORTMACRO Q_DECL_EXPORT #if !defined(Q_MOC_RUN) && !defined(Q_NOREPLY) @@ -910,8 +908,8 @@ signals: void sigWithDefaultArg(int i = 12); private: - bool user1() { return true; }; - bool user2() { return false; }; + bool user1() { return true; } + bool user2() { return false; } template void revisions_T(); QString member2() const { return sMember; } void setMember3( const QString &sVal ) { sMember = sVal; } @@ -1309,8 +1307,6 @@ void tst_Moc::structQObject() #include "namespaced-flags.h" -Q_DECLARE_METATYPE(QList); - void tst_Moc::namespacedFlags() { Foo::Baz baz; @@ -2025,11 +2021,11 @@ struct const_ {}; class QTBUG9354_constInName: public QObject { Q_OBJECT public slots: - void slotChooseScientificConst0(science_constant const &) {}; - void foo(science_const const &) {}; - void foo(constconst const &) {}; - void foo(constconst *) {}; - void foo(const_ *) {}; + void slotChooseScientificConst0(science_constant const &) {} + void foo(science_const const &) {} + void foo(constconst const &) {} + void foo(constconst *) {} + void foo(const_ *) {} }; @@ -2146,7 +2142,7 @@ public: Q_INVOKABLE Q_REVISION(6, 0) void method60() {} enum TestEnum { One, Two }; - Q_ENUM(TestEnum); + Q_ENUM(TestEnum) public slots: @@ -2190,7 +2186,7 @@ public: Q_INVOKABLE Q_REVISION(6, 0) void method60() {} enum TestEnum { One, Two }; - Q_ENUM(TestEnum); + Q_ENUM(TestEnum) public slots: void slot1() {} @@ -3372,7 +3368,6 @@ public: Q_DECLARE_METATYPE(CustomQObject::Number) typedef CustomQObject* CustomQObjectStar; -Q_DECLARE_METATYPE(CustomQObjectStar); namespace SomeNamespace { @@ -3413,7 +3408,6 @@ public: Q_DECLARE_METATYPE(CustomQObject2::Number) typedef CustomQObject2* CustomQObject2Star; -Q_DECLARE_METATYPE(CustomQObject2Star); namespace SomeNamespace2 { @@ -3891,7 +3885,7 @@ namespace QTBUG32933_relatedObjectsDontIncludeItself { Q_PROPERTY(Obj::MyEnum p2 MEMBER member) Q_PROPERTY(NS::Obj::MyEnum p3 MEMBER member) Q_PROPERTY(QTBUG32933_relatedObjectsDontIncludeItself::NS::Obj::MyEnum p4 MEMBER member) - Q_ENUMS(MyEnum); + Q_ENUMS(MyEnum) public: enum MyEnum { Something, SomethingElse }; MyEnum member; @@ -4433,8 +4427,6 @@ void TestFwdProperties::setProp3(const FwdClass3 &v) } TestFwdProperties::~TestFwdProperties() {} -Q_DECLARE_METATYPE(FwdClass1); - void tst_Moc::mocInclude() { TestFwdProperties obj; @@ -4478,7 +4470,8 @@ signals: public: QBindable bindablePublicProperty() { return QBindable(&publicProperty); } - Q_OBJECT_BINDABLE_PROPERTY(ClassWithQPropertyMembers, int, publicProperty, &ClassWithQPropertyMembers::publicPropertyChanged); + Q_OBJECT_BINDABLE_PROPERTY(ClassWithQPropertyMembers, int, publicProperty, + &ClassWithQPropertyMembers::publicPropertyChanged) QProperty notExposed; @@ -4605,7 +4598,7 @@ public: ClassWithPrivateQPropertyShim *q = nullptr; void onTestPropertyChanged() { q->testPropertyChanged(); } - Q_OBJECT_BINDABLE_PROPERTY(Private, int, testProperty, &Private::onTestPropertyChanged); + Q_OBJECT_BINDABLE_PROPERTY(Private, int, testProperty, &Private::onTestPropertyChanged) QProperty testProperty2; }; Private priv{this};