aboutsummaryrefslogtreecommitdiffstats
path: root/tests/pysidetest
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pysidetest')
-rw-r--r--tests/pysidetest/CMakeLists.txt3
-rw-r--r--tests/pysidetest/bug_1016.py12
-rw-r--r--tests/pysidetest/hiddenobject.cpp38
-rw-r--r--tests/pysidetest/hiddenobject.h49
-rw-r--r--tests/pysidetest/pysidetest_global.h5
-rw-r--r--tests/pysidetest/typesystem_pysidetest.xml2
6 files changed, 108 insertions, 1 deletions
diff --git a/tests/pysidetest/CMakeLists.txt b/tests/pysidetest/CMakeLists.txt
index 807463dc9..7661da875 100644
--- a/tests/pysidetest/CMakeLists.txt
+++ b/tests/pysidetest/CMakeLists.txt
@@ -12,11 +12,13 @@ add_definitions(-DRXX_ALLOCATOR_INIT_0)
set(pysidetest_SRC
testobject.cpp
testview.cpp
+hiddenobject.cpp
)
set(pysidetest_MOC_HEADERS
testobject.h
testview.h
+hiddenobject.h
)
qt4_wrap_cpp(pysidetest_MOC_SRC ${pysidetest_MOC_HEADERS})
@@ -86,3 +88,4 @@ PYSIDE_TEST(signalwithdefaultvalue_test.py)
PYSIDE_TEST(signalemissionfrompython_test.py)
PYSIDE_TEST(version_test.py)
PYSIDE_TEST(typedef_signal_test.py)
+PYSIDE_TEST(bug_1016.py)
diff --git a/tests/pysidetest/bug_1016.py b/tests/pysidetest/bug_1016.py
new file mode 100644
index 000000000..38432c62f
--- /dev/null
+++ b/tests/pysidetest/bug_1016.py
@@ -0,0 +1,12 @@
+from testbinding import *
+import unittest
+
+class TestBug1016 (unittest.TestCase):
+
+ def testIt(self):
+ obj = getHiddenObject()
+ self.assertEqual(obj.callMe(), None)
+ self.assertTrue(obj.wasCalled())
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/tests/pysidetest/hiddenobject.cpp b/tests/pysidetest/hiddenobject.cpp
new file mode 100644
index 000000000..00c7bed6e
--- /dev/null
+++ b/tests/pysidetest/hiddenobject.cpp
@@ -0,0 +1,38 @@
+/*
+ * This file is part of the PySide project.
+ *
+ * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * Contact: PySide team <contact@pyside.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "hiddenobject.h"
+
+void HiddenObject::callMe()
+{
+ m_called = true;
+}
+
+bool HiddenObject::wasCalled()
+{
+ return m_called;
+}
+
+QObject* getHiddenObject()
+{
+ return new HiddenObject();
+}
diff --git a/tests/pysidetest/hiddenobject.h b/tests/pysidetest/hiddenobject.h
new file mode 100644
index 000000000..eb02d142d
--- /dev/null
+++ b/tests/pysidetest/hiddenobject.h
@@ -0,0 +1,49 @@
+/*
+ * This file is part of the PySide project.
+ *
+ * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * Contact: PySide team <contact@pyside.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef HIDDENOBJECT_H
+#define HIDDENOBJECT_H
+
+#ifdef pysidetest_EXPORTS
+#define PYSIDE_EXPORTS 1
+#endif
+#include "pysidemacros.h"
+#include <QObject>
+
+// This class shouldn't be exported!
+class HiddenObject : public QObject
+{
+ Q_OBJECT
+public:
+ HiddenObject() : m_called(false) {}
+ Q_INVOKABLE void callMe();
+public slots:
+ bool wasCalled();
+private:
+ bool m_called;
+};
+
+// Return a instance of HiddenObject
+PYSIDE_API QObject* getHiddenObject();
+
+
+#endif
diff --git a/tests/pysidetest/pysidetest_global.h b/tests/pysidetest/pysidetest_global.h
index a7efcf91c..bad6e8e2a 100644
--- a/tests/pysidetest/pysidetest_global.h
+++ b/tests/pysidetest/pysidetest_global.h
@@ -1,3 +1,6 @@
-#include <pyside_global.h>
+// PySide global.h file
+#include "pyside_global.h"
#include "testobject.h"
#include "testview.h"
+#define PYSIDE_API
+#include "hiddenobject.h"
diff --git a/tests/pysidetest/typesystem_pysidetest.xml b/tests/pysidetest/typesystem_pysidetest.xml
index 5077f6b26..fb9b82b6f 100644
--- a/tests/pysidetest/typesystem_pysidetest.xml
+++ b/tests/pysidetest/typesystem_pysidetest.xml
@@ -6,6 +6,8 @@
<primitive-type name="TypedefValue"/>
<object-type name="TestObject" />
+ <function signature="getHiddenObject()" />
+
<inject-code position="end">
Shiboken::TypeResolver::createObjectTypeResolver&lt; ::PySideCPP2::TestObjectWithoutNamespace>("TestObjectWithoutNamespace*");
Shiboken::TypeResolver::createValueTypeResolver&lt; ::PySideCPP2::PySideLong>("PySideLong");