diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-05-07 09:21:23 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-05-07 21:50:58 +0200 |
commit | 300dec66ce18b63a08027ef9f200117e87902274 (patch) | |
tree | ab4719e81ceff1f7268a358f93a4d7a289e73c92 /src/tools | |
parent | d5c3e1336bce42df53d4b525237244486ba5422d (diff) |
QMetaMethod: Store method constness in metaobject system
[ChangeLog][QtCore][QMetaMethod] It is now possible to query the
constness of a method with QMetaMethod::isConst.
Change-Id: I8a94480b8074ef5b30555aeccd64937c4c6d97d4
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/moc/generator.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index ad3df36292..37797ef7db 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -747,7 +747,7 @@ void Generator::generateFunctions(const QList<FunctionDef> &list, const char *fu const FunctionDef &f = list.at(i); QByteArray comment; - unsigned char flags = type; + uint flags = type; if (f.access == FunctionDef::Private) { flags |= AccessPrivate; comment.append("Private"); @@ -775,6 +775,11 @@ void Generator::generateFunctions(const QList<FunctionDef> &list, const char *fu comment.append(" | MethodRevisioned"); } + if (f.isConst) { + flags |= MethodIsConst; + comment.append(" | MethodIsConst "); + } + int argc = f.arguments.count(); fprintf(out, " %4d, %4d, %4d, %4d, 0x%02x, %4d /* %s */,\n", stridx(f.name), argc, paramsIndex, stridx(f.tag), flags, initialMetatypeOffset, comment.constData()); |