6.5.3 clean

This commit is contained in:
kleuter
2023-11-01 18:02:52 +01:00
parent bbe896803b
commit 7018d9e6c8
2170 changed files with 57471 additions and 43550 deletions

View File

@ -60,6 +60,8 @@
#include "qmlmacro.h"
using namespace Qt::StringLiterals;
#ifdef Q_MOC_RUN
// check that moc can parse these constructs, they are being used in Windows winsock2.h header
#define STRING_HASH_HASH(x) ("foo" ## x ## "bar")
@ -79,6 +81,19 @@ Q_DECLARE_METATYPE(const QMetaObject*);
#define TESTEXPORTMACRO Q_DECL_EXPORT
#if !defined(Q_MOC_RUN) && !defined(Q_NOREPLY)
# define Q_NOREPLY
#endif
struct TagTest : QObject {
Q_OBJECT
Q_INVOKABLE Q_NOREPLY inline int test() {return 0;}
public slots:
Q_NOREPLY virtual inline void pamOpen(int){}
};
namespace TestNonQNamespace {
struct TestGadget {
@ -577,6 +592,10 @@ private slots:
QT_WARNING_POP
// quick test to verify that moc handles the L suffix
// correctly in the preprocessor
#if 2000L < 1
#else
class PropertyTestClass : public QObject
{
Q_OBJECT
@ -586,6 +605,7 @@ public:
Q_ENUM(TestEnum)
};
#endif
class PropertyUseClass : public QObject
{
@ -758,6 +778,7 @@ private slots:
void setQPRopertyBinding();
void privateQPropertyShim();
void readWriteThroughBindable();
void virtualInlineTaggedSlot();
signals:
void sigWithUnsignedArg(unsigned foo);
@ -2296,6 +2317,13 @@ void tst_Moc::warnings_data()
<< QString()
<< QString("standard input:3:1: error: Parse error at \"decltype\"");
QTest::newRow("QTBUG-36367: report correct error location")
<< "class X { \n Q_PROPERTY(Foo* foo NONSENSE foo) \n };"_ba
<< QStringList()
<< 1
<< QString()
<< u"standard input:2:1: error: Parse error at \"NONSENSE\""_s;
#ifdef Q_OS_UNIX // Limit to Unix because the error message is platform-dependent
QTest::newRow("Q_PLUGIN_METADATA: unreadable file")
<< QByteArray("class X { \n Q_PLUGIN_METADATA(FILE \".\") \n };")
@ -4426,6 +4454,20 @@ void tst_Moc::readWriteThroughBindable()
}
}
void tst_Moc::virtualInlineTaggedSlot()
{
auto mo = TagTest::staticMetaObject;
auto idx = mo.indexOfMethod("pamOpen(int)");
auto method = mo.method(idx);
QVERIFY(method.isValid()); // fails!
QCOMPARE(method.tag(), "Q_NOREPLY");
idx = mo.indexOfMethod("test()");
method = mo.method(idx);
QVERIFY(method.isValid());
QCOMPARE(method.tag(), "Q_NOREPLY");
QCOMPARE(method.returnMetaType(), QMetaType::fromType<int>());
}
QTEST_MAIN(tst_Moc)
// the generated code must compile with QT_NO_KEYWORDS