summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/kernel/qobject/tst_qobject.cpp')
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp29
1 files changed, 24 insertions, 5 deletions
diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
index 24cfe8f3bc..263cc5a07a 100644
--- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
+++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
-** Copyright (C) 2013 Olivier Goffart <ogoffart@woboq.com>
+** Copyright (C) 2015 Olivier Goffart <ogoffart@woboq.com>
** Contact: http://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -91,9 +91,7 @@ private slots:
void floatProperty();
void qrealProperty();
void property();
-#ifndef QT_NO_PROCESS
void recursiveSignalEmission();
-#endif
void signalBlocking();
void blockingQueuedConnection();
void childEvents();
@@ -129,6 +127,7 @@ private slots:
void connectConvert();
void connectWithReference();
void connectManyArguments();
+ void connectForwardDeclare();
void returnValue_data();
void returnValue();
void returnValue2_data();
@@ -2981,9 +2980,11 @@ void tst_QObject::dynamicProperties()
QVERIFY(obj.dynamicPropertyNames().isEmpty());
}
-#ifndef QT_NO_PROCESS
void tst_QObject::recursiveSignalEmission()
{
+#ifdef QT_NO_PROCESS
+ QSKIP("No qprocess support", SkipAll);
+#else
QProcess proc;
// signalbug helper app should always be next to this test binary
const QString path = QStringLiteral("signalbug/signalbug");
@@ -2992,8 +2993,8 @@ void tst_QObject::recursiveSignalEmission()
QVERIFY(proc.waitForFinished());
QVERIFY(proc.exitStatus() == QProcess::NormalExit);
QCOMPARE(proc.exitCode(), 0);
-}
#endif
+}
void tst_QObject::signalBlocking()
{
@@ -5208,6 +5209,24 @@ void tst_QObject::connectManyArguments()
QCOMPARE(ManyArgumentNamespace::count, 12);
}
+class ForwardDeclared;
+
+class ForwardDeclareArguments : public QObject
+{
+ Q_OBJECT
+signals:
+ void mySignal(const ForwardDeclared&);
+public slots:
+ void mySlot(const ForwardDeclared&) {}
+};
+
+void tst_QObject::connectForwardDeclare()
+{
+ ForwardDeclareArguments ob;
+ // it should compile
+ QVERIFY(connect(&ob, &ForwardDeclareArguments::mySignal, &ob, &ForwardDeclareArguments::mySlot, Qt::QueuedConnection));
+}
+
class ReturnValue : public QObject {
friend class tst_QObject;
Q_OBJECT