summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-01-05 14:10:38 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2011-01-05 14:35:11 -0200
commit6383832408576175b60f608e02fa3424f782dbed (patch)
tree4f17a0570101c61f191e95d36f27a3faf26f186c
parented1c0014f902cae7b1820fc89fde1dd227beddc8 (diff)
downloadpyside-6383832408576175b60f608e02fa3424f782dbed.tar.gz
pyside-6383832408576175b60f608e02fa3424f782dbed.tar.xz
pyside-6383832408576175b60f608e02fa3424f782dbed.zip
Fix bug#557 - "Segmentation fault in QDeclarativeComponent.loadUrl()"
The signature QDeclarativeComponent(QObject*) should not exist, it's not documented and just creates a useless QDeclarativeComponent when used, useless in the sense that it will segfault when used. Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Renato Ara├║jo <renato.filho@openbossa.org>
-rw-r--r--PySide/QtDeclarative/typesystem_declarative.xml1
-rw-r--r--tests/QtDeclarative/CMakeLists.txt1
-rw-r--r--tests/QtDeclarative/bug_557.py14
3 files changed, 16 insertions, 0 deletions
diff --git a/PySide/QtDeclarative/typesystem_declarative.xml b/PySide/QtDeclarative/typesystem_declarative.xml
index 05d72e8..5649bf2 100644
--- a/PySide/QtDeclarative/typesystem_declarative.xml
+++ b/PySide/QtDeclarative/typesystem_declarative.xml
@@ -66,6 +66,7 @@
<object-type name="QDeclarativeExtensionInterface"/>
<object-type name="QDeclarativeComponent">
<enum-type name="Status"/>
+ <modify-function signature="QDeclarativeComponent(QObject*)" remove="all" />
</object-type>
<object-type name="QDeclarativeContext">
<modify-function signature="setContextProperty(const QString &amp;, QObject*)">
diff --git a/tests/QtDeclarative/CMakeLists.txt b/tests/QtDeclarative/CMakeLists.txt
index 5cd53e9..84bc495 100644
--- a/tests/QtDeclarative/CMakeLists.txt
+++ b/tests/QtDeclarative/CMakeLists.txt
@@ -1,5 +1,6 @@
PYSIDE_TEST(bug_451.py)
PYSIDE_TEST(bug_456.py)
+PYSIDE_TEST(bug_557.py)
PYSIDE_TEST(qdeclarativenetwork_test.py)
PYSIDE_TEST(qdeclarativeview_test.py)
PYSIDE_TEST(connect_python_qml.py)
diff --git a/tests/QtDeclarative/bug_557.py b/tests/QtDeclarative/bug_557.py
new file mode 100644
index 0000000..c78aaf1
--- /dev/null
+++ b/tests/QtDeclarative/bug_557.py
@@ -0,0 +1,14 @@
+from PySide.QtCore import *
+from PySide.QtGui import *
+from PySide.QtDeclarative import *
+
+import sys
+
+app = QApplication(sys.argv)
+
+engine = QDeclarativeEngine()
+component = QDeclarativeComponent(engine)
+
+# This should segfault if the QDeclarativeComponent has not QDeclarativeEngine
+component.loadUrl(QUrl.fromLocalFile('foo.qml'))
+