summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Alcantara <pcacjr@gmail.com>2011-11-25 15:28:03 -0300
committerPaulo Alcantara <pcacjr@gmail.com>2011-11-25 16:26:01 -0300
commit6a1e70e085fa4f4e71a1c20189ac2115ebe5f19f (patch)
tree357467da5c05eced4a0402f15c3505a502e2ecb3
parentc3fc0784f8bc2e17f668cd0eb40f06e3cb7d008b (diff)
downloadpyside-6a1e70e085fa4f4e71a1c20189ac2115ebe5f19f.tar.gz
pyside-6a1e70e085fa4f4e71a1c20189ac2115ebe5f19f.tar.xz
pyside-6a1e70e085fa4f4e71a1c20189ac2115ebe5f19f.zip
Fix BUG #1048
Signed-off-by: Paulo Alcantara <pcacjr@gmail.com> Reviewer: Willer Moreira <willer.moreira@openbossa.org> Hugo Parente Lima <hugo.lima@openbossa.org>
-rw-r--r--PySide/QtGui/glue/qlayout_help_functions.h3
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/bug_1048.py8
3 files changed, 12 insertions, 0 deletions
diff --git a/PySide/QtGui/glue/qlayout_help_functions.h b/PySide/QtGui/glue/qlayout_help_functions.h
index 41b3153..00f0dbd 100644
--- a/PySide/QtGui/glue/qlayout_help_functions.h
+++ b/PySide/QtGui/glue/qlayout_help_functions.h
@@ -63,6 +63,9 @@ inline void addLayoutOwnership(QLayout* layout, QLayout* other)
inline void addLayoutOwnership(QLayout* layout, QLayoutItem* item)
{
+ if (!item)
+ return;
+
QWidget* w = item->widget();
if (w)
addLayoutOwnership(layout, w);
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 6a4cfe3..acb9a67 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -79,6 +79,7 @@ PYSIDE_TEST(bug_991.py)
PYSIDE_TEST(bug_998.py)
PYSIDE_TEST(bug_1002.py)
PYSIDE_TEST(bug_1006.py)
+PYSIDE_TEST(bug_1048.py)
PYSIDE_TEST(customproxywidget_test.py)
PYSIDE_TEST(deepcopy_test.py)
PYSIDE_TEST(event_filter_test.py)
diff --git a/tests/QtGui/bug_1048.py b/tests/QtGui/bug_1048.py
new file mode 100644
index 0000000..222c3a6
--- /dev/null
+++ b/tests/QtGui/bug_1048.py
@@ -0,0 +1,8 @@
+from PySide import QtGui
+
+a = QtGui.QApplication([])
+
+w = QtGui.QWidget()
+l = QtGui.QGridLayout(w)
+
+l.itemAtPosition(0, 0)