diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2023-08-11 10:45:51 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2024-01-26 14:51:35 +0100 |
commit | ac001bef798b79f4932d7ca8f4fb812159ba75ca (patch) | |
tree | 1cf783aa9235c4cf72e64d3775957ee6d621870c /src/tools/moc/moc.cpp | |
parent | 941afac108aded21ea50caeec0b72291fcad7d59 (diff) |
moc/QMetaProperty: Remove limitation on non-own-class notify signals
The moc generated code does a sanity check that NOTIFY signals actually
exist in the parent class when they cannot be found in the class moc
currently runs on.
The logic there was however too simplistic, and couldn't deal with
signals taking a parameter.
Fix this, and take the opportunity to use a proper static_assert instead
of generating a "normal" compile error.
We do not do any checks for the presence of QPrivateSignal, as the whole
point of QPrivateSignal is that it should be private (and not e.g.
protected).
Moreover, we adjust QMetaProperty::notifySignalIndex to take
single-argument notify methods into consideration as well when
encontering an unresolved notify index.
Fixes: QTBUG-115989
Pick-to: 6.7
Change-Id: I8a056a15777f3132691e207b4b9ab6c2c9b2126d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/tools/moc/moc.cpp')
-rw-r--r-- | src/tools/moc/moc.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index e100ff4ba8..b471418a27 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -1167,6 +1167,7 @@ void Moc::generate(FILE *out, FILE *jsonOutput) fprintf(out, "\n#include <QtCore/qtmochelpers.h>\n"); fprintf(out, "\n#include <memory>\n\n"); // For std::addressof + fprintf(out, "\n#include <QtCore/qxptype_traits.h>\n"); // is_detected fprintf(out, "#if !defined(Q_MOC_OUTPUT_REVISION)\n" "#error \"The header file '%s' doesn't include <QObject>.\"\n", fn.constData()); |