aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-01-31 15:46:23 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:53:51 -0300
commitfd8b33616fe6a1c5ceaa0b227843d65f2d1eeae6 (patch)
tree561112ad622f5f7fec830d3ac7c26852eeb60296
parentc89f03fe396278de485dbbebe681b33fc3e91427 (diff)
Fix bug 656 - "cannot inherit from QCoreApplication"
Reviewer: Renato Araújo <renato.filho@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r--PySide/QtCore/glue/qcoreapplication_init.cpp2
-rw-r--r--tests/QtCore/CMakeLists.txt1
-rw-r--r--tests/QtCore/bug_656.py9
3 files changed, 11 insertions, 1 deletions
diff --git a/PySide/QtCore/glue/qcoreapplication_init.cpp b/PySide/QtCore/glue/qcoreapplication_init.cpp
index 0c0e1f8fe..15e3e1118 100644
--- a/PySide/QtCore/glue/qcoreapplication_init.cpp
+++ b/PySide/QtCore/glue/qcoreapplication_init.cpp
@@ -4,7 +4,7 @@ static char** QCoreApplicationArgValues;
int Sbk_QCoreApplication_Init(PyObject* self, PyObject* args, PyObject*)
{
- if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType<QApplication >()))
+ if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType<QCoreApplication >()))
return -1;
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index c53002b2b..c6f9ffd43 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -5,6 +5,7 @@ PYSIDE_TEST(bug_428.py)
PYSIDE_TEST(bug_462.py)
PYSIDE_TEST(bug_505.py)
PYSIDE_TEST(bug_515.py)
+PYSIDE_TEST(bug_656.py)
PYSIDE_TEST(blocking_signals_test.py)
PYSIDE_TEST(child_event_test.py)
PYSIDE_TEST(deepcopy_test.py)
diff --git a/tests/QtCore/bug_656.py b/tests/QtCore/bug_656.py
new file mode 100644
index 000000000..ba5617447
--- /dev/null
+++ b/tests/QtCore/bug_656.py
@@ -0,0 +1,9 @@
+from PySide.QtCore import *
+
+class CoreApp(QCoreApplication):
+ def __init__(self,*args):
+ super(CoreApp,self).__init__(*args)
+ # It shouldn't crash after the __init__ call
+
+import sys
+app = CoreApp(sys.argv)