summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-09-13 17:44:17 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2011-09-13 20:24:08 -0300
commit60f657f0174e8e95e1d30a605dd87d70d64f73cd (patch)
tree23f850e71fc2f1be67d367b2bb9769b791d18bc9
parentde31fbd3fe3bca3bbb3f794c2932ad60ae941e5f (diff)
downloadpyside-60f657f0174e8e95e1d30a605dd87d70d64f73cd.tar.gz
pyside-60f657f0174e8e95e1d30a605dd87d70d64f73cd.tar.xz
pyside-60f657f0174e8e95e1d30a605dd87d70d64f73cd.zip
Unit test for bug 995 - "QDeclarativeView.itemAt returns faulty reference. (leading to SEGFAULT)"
-rw-r--r--tests/QtDeclarative/CMakeLists.txt1
-rw-r--r--tests/QtDeclarative/bug_995.py13
-rw-r--r--tests/QtDeclarative/bug_995.qml12
3 files changed, 26 insertions, 0 deletions
diff --git a/tests/QtDeclarative/CMakeLists.txt b/tests/QtDeclarative/CMakeLists.txt
index 94e994a..be3fb3c 100644
--- a/tests/QtDeclarative/CMakeLists.txt
+++ b/tests/QtDeclarative/CMakeLists.txt
@@ -8,6 +8,7 @@ PYSIDE_TEST(bug_847.py)
PYSIDE_TEST(bug_915.py)
PYSIDE_TEST(bug_926.py)
PYSIDE_TEST(bug_951.py)
+PYSIDE_TEST(bug_995.py)
PYSIDE_TEST(bug_997.py)
PYSIDE_TEST(qdeclarativenetwork_test.py)
PYSIDE_TEST(qdeclarativeview_test.py)
diff --git a/tests/QtDeclarative/bug_995.py b/tests/QtDeclarative/bug_995.py
new file mode 100644
index 0000000..acdf148
--- /dev/null
+++ b/tests/QtDeclarative/bug_995.py
@@ -0,0 +1,13 @@
+from PySide.QtGui import *
+from PySide.QtDeclarative import *
+from helper import adjust_filename, UsesQApplication
+
+app = QApplication([])
+view = QDeclarativeView(adjust_filename('bug_995.qml', __file__))
+view.show()
+view.resize(200, 200)
+item = view.itemAt(100, 100)
+
+# it CAN NOT crash here
+print item
+
diff --git a/tests/QtDeclarative/bug_995.qml b/tests/QtDeclarative/bug_995.qml
new file mode 100644
index 0000000..7603700
--- /dev/null
+++ b/tests/QtDeclarative/bug_995.qml
@@ -0,0 +1,12 @@
+import Qt 4.7
+
+Rectangle {
+ width: 100
+ height: 100
+ color: "red"
+
+ Text {
+ text: "Hello World"
+ anchors.centerIn: parent
+ }
+}