moc: fix GCC -Wextra-semi colon after member function definitions

As pointed out by Thiago the QT_DECLARE_METATYPE calls are redundant, so
remove them.

Task-number: QTBUG-132101
Pick-to: 6.8
Change-Id: I73800e70d3f270fb87941d4e053aa7ac5ed1841c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3bb4c4949fed9ccf8653151c78d5130b8db00716)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Ahmad Samir 2024-12-19 11:27:02 +02:00 committed by Qt Cherry-pick Bot
parent 5171b7f488
commit 01edc916d2
2 changed files with 14 additions and 21 deletions

View File

@ -21,7 +21,7 @@ public:
const QHash<QByteArray, QByteArray> &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);

View File

@ -107,8 +107,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)
@ -913,8 +911,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 <class T> void revisions_T();
QString member2() const { return sMember; }
void setMember3( const QString &sVal ) { sMember = sVal; }
@ -1320,8 +1318,6 @@ void tst_Moc::structQObject()
#include "namespaced-flags.h"
Q_DECLARE_METATYPE(QList<Foo::Bar::Flags>);
void tst_Moc::namespacedFlags()
{
Foo::Baz baz;
@ -2036,11 +2032,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_ *) {}
};
@ -2157,7 +2153,7 @@ public:
Q_INVOKABLE Q_REVISION(6, 0) void method60() {}
enum TestEnum { One, Two };
Q_ENUM(TestEnum);
Q_ENUM(TestEnum)
public slots:
@ -2201,7 +2197,7 @@ public:
Q_INVOKABLE Q_REVISION(6, 0) void method60() {}
enum TestEnum { One, Two };
Q_ENUM(TestEnum);
Q_ENUM(TestEnum)
public slots:
void slot1() {}
@ -3402,7 +3398,6 @@ public:
Q_DECLARE_METATYPE(CustomQObject::Number)
typedef CustomQObject* CustomQObjectStar;
Q_DECLARE_METATYPE(CustomQObjectStar);
namespace SomeNamespace {
@ -3443,7 +3438,6 @@ public:
Q_DECLARE_METATYPE(CustomQObject2::Number)
typedef CustomQObject2* CustomQObject2Star;
Q_DECLARE_METATYPE(CustomQObject2Star);
namespace SomeNamespace2 {
@ -3921,7 +3915,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;
@ -4511,8 +4505,6 @@ void TestFwdProperties::setProp3(const FwdClass3 &v)
}
TestFwdProperties::~TestFwdProperties() {}
Q_DECLARE_METATYPE(FwdClass1);
void tst_Moc::mocInclude()
{
TestFwdProperties obj;
@ -4556,7 +4548,8 @@ signals:
public:
QBindable<int> bindablePublicProperty() { return QBindable<int>(&publicProperty); }
Q_OBJECT_BINDABLE_PROPERTY(ClassWithQPropertyMembers, int, publicProperty, &ClassWithQPropertyMembers::publicPropertyChanged);
Q_OBJECT_BINDABLE_PROPERTY(ClassWithQPropertyMembers, int, publicProperty,
&ClassWithQPropertyMembers::publicPropertyChanged)
QProperty<int> notExposed;
@ -4683,7 +4676,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<int> testProperty2;
};
Private priv{this};