summaryrefslogtreecommitdiffstats
path: root/tests/QtUiTools
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-01-18 16:59:06 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2011-01-21 10:30:21 -0200
commitb9679215b8eb39d18a774339828f55e57d479c5c (patch)
treebe49c5ee9c47c72da51fe2346f74a1f8a12691c1 /tests/QtUiTools
parent7f533799d442fbb1ffe5fb9be9a7174779d9e133 (diff)
downloadpyside-b9679215b8eb39d18a774339828f55e57d479c5c.tar.gz
pyside-b9679215b8eb39d18a774339828f55e57d479c5c.tar.xz
pyside-b9679215b8eb39d18a774339828f55e57d479c5c.zip
Fix bug#552 - "Segmentation fault when using QUiLoader and QTabWidget"
Reviewer: Renato Ara├║jo <renato.filho@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'tests/QtUiTools')
-rw-r--r--tests/QtUiTools/CMakeLists.txt1
-rw-r--r--tests/QtUiTools/bug_552.py21
-rw-r--r--tests/QtUiTools/bug_552.ui42
3 files changed, 64 insertions, 0 deletions
diff --git a/tests/QtUiTools/CMakeLists.txt b/tests/QtUiTools/CMakeLists.txt
index ebf7a23..131adfe 100644
--- a/tests/QtUiTools/CMakeLists.txt
+++ b/tests/QtUiTools/CMakeLists.txt
@@ -2,5 +2,6 @@ PYSIDE_TEST(bug_360.py)
PYSIDE_TEST(bug_376.py)
PYSIDE_TEST(bug_392.py)
PYSIDE_TEST(bug_426.py)
+PYSIDE_TEST(bug_552.py)
PYSIDE_TEST(uiloader_test.py)
PYSIDE_TEST(ui_test.py)
diff --git a/tests/QtUiTools/bug_552.py b/tests/QtUiTools/bug_552.py
new file mode 100644
index 0000000..6a93040
--- /dev/null
+++ b/tests/QtUiTools/bug_552.py
@@ -0,0 +1,21 @@
+from helper import adjust_filename
+from PySide import QtGui, QtCore
+from PySide.QtUiTools import QUiLoader
+
+class View_1(QtGui.QWidget):
+
+ def __init__(self):
+ QtGui.QWidget.__init__(self)
+ loader = QUiLoader()
+ widget = loader.load(adjust_filename('bug_552.ui', __file__), self)
+ self.children = []
+ for child in widget.findChildren(QtCore.QObject, None):
+ self.children.append(child)
+ self.t = widget.tabWidget
+ self.t.removeTab(0)
+
+app = QtGui.QApplication([])
+window = View_1()
+window.show()
+
+# If it doesn't crash it works :-)
diff --git a/tests/QtUiTools/bug_552.ui b/tests/QtUiTools/bug_552.ui
new file mode 100644
index 0000000..f98da44
--- /dev/null
+++ b/tests/QtUiTools/bug_552.ui
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="geometry">
+ <rect>
+ <x>130</x>
+ <y>80</y>
+ <width>139</width>
+ <height>80</height>
+ </rect>
+ </property>
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab">
+ <attribute name="title">
+ <string>Tab 1</string>
+ </attribute>
+ </widget>
+ <widget class="QWidget" name="tab_2">
+ <attribute name="title">
+ <string>Tab 2</string>
+ </attribute>
+ </widget>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>