aboutsummaryrefslogtreecommitdiffstats
path: root/tests/pysidetest/testobject.h
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-02-04 19:07:04 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:53:55 -0300
commit1155542ecca6ab5d8ee00aececae453d980ac690 (patch)
tree1edfafbfd35c426b73255ed0814e1efb7a9412c0 /tests/pysidetest/testobject.h
parent4ebad6745f9c85dd4f074fe328e0dd36ca8d6c18 (diff)
Created unit test for signals.
Test for types inside of namespace Test for types defined by typedef. Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests/pysidetest/testobject.h')
-rw-r--r--tests/pysidetest/testobject.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/pysidetest/testobject.h b/tests/pysidetest/testobject.h
index 8dcb4c06d..ca662d70e 100644
--- a/tests/pysidetest/testobject.h
+++ b/tests/pysidetest/testobject.h
@@ -2,6 +2,7 @@
#define TESTOBJECT_H
#include <QObject>
+#include <QMetaType>
#ifdef pysidetest_EXPORTS
#define PYSIDE_EXPORTS 1
#endif
@@ -34,5 +35,55 @@ private:
QList<QObject*> m_children;
};
+
+typedef int PySideInt;
+
+
+namespace PySideCPP {
+
+class PYSIDE_API TestObjectWithNamespace : public QObject
+{
+ Q_OBJECT
+public:
+ TestObjectWithNamespace(QObject* parent) : QObject(parent) {}
+ QString name() { return "TestObjectWithNamespace"; }
+
+ void callSignal(TestObjectWithNamespace* obj) { emitSignal(obj); }
+ void callSignalWithNamespace(TestObjectWithNamespace* obj) { emitSignalWithNamespace(obj); }
+ void callSignalWithTypedef(int val) { emitSignalWithTypedef(val); }
+
+signals:
+ void emitSignal(TestObjectWithNamespace* obj);
+ void emitSignalWithNamespace(PySideCPP::TestObjectWithNamespace* obj);
+ void emitSignalWithTypedef(PySideInt val);
+};
+
+
+} // Namespace PySideCPP
+
+namespace PySideCPP2 {
+
+typedef long PySideLong;
+
+class PYSIDE_API TestObjectWithoutNamespace : public QObject
+{
+ Q_OBJECT
+public:
+ TestObjectWithoutNamespace(QObject* parent) : QObject(parent) {}
+ QString name() { return "TestObjectWithoutNamespace"; }
+
+ void callSignal(TestObjectWithoutNamespace* obj) { emitSignal(obj); }
+ void callSignalWithNamespace(TestObjectWithoutNamespace* obj) { emitSignalWithNamespace(obj); }
+ void callSignalWithTypedef(long val) { emitSignalWithTypedef(val); }
+
+signals:
+ void emitSignal(TestObjectWithoutNamespace* obj);
+ void emitSignalWithNamespace(PySideCPP2::TestObjectWithoutNamespace* obj);
+ void emitSignalWithTypedef(PySideLong val);
+};
+
+
+} // Namespace PySideCPP2
+
#endif // TESTOBJECT_H