summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/tools/moc/CMakeLists.txt1
-rw-r--r--tests/auto/tools/moc/allmocs_baseline_in.json36
-rw-r--r--tests/auto/tools/moc/signal-with-default-arg.h16
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp3
4 files changed, 56 insertions, 0 deletions
diff --git a/tests/auto/tools/moc/CMakeLists.txt b/tests/auto/tools/moc/CMakeLists.txt
index b01b92b634..4fac3f89da 100644
--- a/tests/auto/tools/moc/CMakeLists.txt
+++ b/tests/auto/tools/moc/CMakeLists.txt
@@ -41,6 +41,7 @@ set(JSON_HEADERS
related-metaobjects-in-gadget.h
related-metaobjects-in-namespaces.h
related-metaobjects-name-conflict.h
+ signal-with-default-arg.h
single-quote-digit-separator-n3781.h
single_function_keyword.h
slots-with-void-template.h
diff --git a/tests/auto/tools/moc/allmocs_baseline_in.json b/tests/auto/tools/moc/allmocs_baseline_in.json
index e1c6a5d7d8..46f643d09b 100644
--- a/tests/auto/tools/moc/allmocs_baseline_in.json
+++ b/tests/auto/tools/moc/allmocs_baseline_in.json
@@ -2450,6 +2450,42 @@
{
"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": [
+ {
"className": "KDAB",
"enums": [
{
diff --git a/tests/auto/tools/moc/signal-with-default-arg.h b/tests/auto/tools/moc/signal-with-default-arg.h
new file mode 100644
index 0000000000..3293328932
--- /dev/null
+++ b/tests/auto/tools/moc/signal-with-default-arg.h
@@ -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
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index 3ed8f1a766..35c31b6b87 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -56,6 +56,8 @@
#include "fwdclass2.h"
#include "fwdclass3.h"
+#include "signal-with-default-arg.h"
+
#include "qmlmacro.h"
#ifdef Q_MOC_RUN
@@ -767,6 +769,7 @@ signals:
void constSignal2(int arg) const;
void member4Changed();
void member5Changed(const QString &newVal);
+ void sigWithDefaultArg(int i = 12);
private:
bool user1() { return true; };