moc: Output the "cloned" flag for methods
We will need it in QML to determine which signal out of a number of "overloads" to generate handlers for. Task-number: QTBUG-108762 Change-Id: Ib73eeb59dbf037bd03faf0d841860d9ebc9e7032 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
parent
7d7ed24f51
commit
481338751b
@ -2020,6 +2020,9 @@ QJsonObject FunctionDef::toJson() const
|
|||||||
if (revision > 0)
|
if (revision > 0)
|
||||||
fdef["revision"_L1] = revision;
|
fdef["revision"_L1] = revision;
|
||||||
|
|
||||||
|
if (wasCloned)
|
||||||
|
fdef["isCloned"_L1] = true;
|
||||||
|
|
||||||
return fdef;
|
return fdef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ set(JSON_HEADERS
|
|||||||
related-metaobjects-in-gadget.h
|
related-metaobjects-in-gadget.h
|
||||||
related-metaobjects-in-namespaces.h
|
related-metaobjects-in-namespaces.h
|
||||||
related-metaobjects-name-conflict.h
|
related-metaobjects-name-conflict.h
|
||||||
|
signal-with-default-arg.h
|
||||||
single-quote-digit-separator-n3781.h
|
single-quote-digit-separator-n3781.h
|
||||||
single_function_keyword.h
|
single_function_keyword.h
|
||||||
slots-with-void-template.h
|
slots-with-void-template.h
|
||||||
|
@ -2447,6 +2447,42 @@
|
|||||||
"inputFile": "related-metaobjects-name-conflict.h",
|
"inputFile": "related-metaobjects-name-conflict.h",
|
||||||
"outputRevision": 68
|
"outputRevision": 68
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"classes": [
|
||||||
|
{
|
||||||
|
"className": "SignalWithDefaultArg",
|
||||||
|
"object": true,
|
||||||
|
"qualifiedClassName": "SignalWithDefaultArg",
|
||||||
|
"signals": [
|
||||||
|
{
|
||||||
|
"access": "public",
|
||||||
|
"arguments": [
|
||||||
|
{
|
||||||
|
"name": "i",
|
||||||
|
"type": "int"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "signalWithDefaultArg",
|
||||||
|
"returnType": "void"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"access": "public",
|
||||||
|
"isCloned": true,
|
||||||
|
"name": "signalWithDefaultArg",
|
||||||
|
"returnType": "void"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"superClasses": [
|
||||||
|
{
|
||||||
|
"access": "public",
|
||||||
|
"name": "QObject"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"inputFile": "signal-with-default-arg.h",
|
||||||
|
"outputRevision": 68
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"classes": [
|
"classes": [
|
||||||
{
|
{
|
||||||
|
16
tests/auto/tools/moc/signal-with-default-arg.h
Normal file
16
tests/auto/tools/moc/signal-with-default-arg.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// Copyright (C) 2022 The Qt Company Ltd.
|
||||||
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||||
|
|
||||||
|
#ifndef SIGNAL_WITH_DEFAULT_ARG_H
|
||||||
|
#define SIGNAL_WITH_DEFAULT_ARG_H
|
||||||
|
|
||||||
|
#include <QtCore/qobject.h>
|
||||||
|
|
||||||
|
class SignalWithDefaultArg : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
signals:
|
||||||
|
void signalWithDefaultArg(int i = 12);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // SIGNAL_WITH_DEFAULT_ARG_H
|
@ -56,6 +56,8 @@
|
|||||||
#include "fwdclass2.h"
|
#include "fwdclass2.h"
|
||||||
#include "fwdclass3.h"
|
#include "fwdclass3.h"
|
||||||
|
|
||||||
|
#include "signal-with-default-arg.h"
|
||||||
|
|
||||||
#include "qmlmacro.h"
|
#include "qmlmacro.h"
|
||||||
|
|
||||||
#ifdef Q_MOC_RUN
|
#ifdef Q_MOC_RUN
|
||||||
@ -767,6 +769,7 @@ signals:
|
|||||||
void constSignal2(int arg) const;
|
void constSignal2(int arg) const;
|
||||||
void member4Changed();
|
void member4Changed();
|
||||||
void member5Changed(const QString &newVal);
|
void member5Changed(const QString &newVal);
|
||||||
|
void sigWithDefaultArg(int i = 12);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool user1() { return true; };
|
bool user1() { return true; };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user