summaryrefslogtreecommitdiffstats
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>2011-01-31 16:22:28 -0200
commit43a8f4089e93fc48556f42ec49db8d06784b49ae (patch)
treee423e92851f97774e1255338df4720b4e72d7ad8
parentf2c537eeaaf7ae88f28a7875ce941287c1a3a4d3 (diff)
downloadpyside-43a8f4089e93fc48556f42ec49db8d06784b49ae.tar.gz
pyside-43a8f4089e93fc48556f42ec49db8d06784b49ae.tar.xz
pyside-43a8f4089e93fc48556f42ec49db8d06784b49ae.zip
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 0c0e1f8..15e3e11 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 c53002b..c6f9ffd 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 0000000..ba56174
--- /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)