aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-08-15 17:56:53 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:44 -0300
commite3502d00fc5c8a9641641de8e8b5bafe7ea51fe4 (patch)
tree4a263f15536fbe9529753215641d6042f09543af /tests
parent00bd60cfdac4c488b897fa7a0b55da625054a10c (diff)
Created unit test for bug #958.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/QtUiTools/CMakeLists.txt1
-rw-r--r--tests/QtUiTools/bug_958.py24
-rw-r--r--tests/QtUiTools/bug_958.ui48
3 files changed, 73 insertions, 0 deletions
diff --git a/tests/QtUiTools/CMakeLists.txt b/tests/QtUiTools/CMakeLists.txt
index 10fecd54b..eecf3df8f 100644
--- a/tests/QtUiTools/CMakeLists.txt
+++ b/tests/QtUiTools/CMakeLists.txt
@@ -6,6 +6,7 @@ PYSIDE_TEST(bug_552.py)
PYSIDE_TEST(bug_797.py)
PYSIDE_TEST(bug_909.py)
PYSIDE_TEST(bug_913.py)
+PYSIDE_TEST(bug_958.py)
PYSIDE_TEST(bug_965.py)
PYSIDE_TEST(uiloader_test.py)
PYSIDE_TEST(ui_test.py)
diff --git a/tests/QtUiTools/bug_958.py b/tests/QtUiTools/bug_958.py
new file mode 100644
index 000000000..07ca8b49b
--- /dev/null
+++ b/tests/QtUiTools/bug_958.py
@@ -0,0 +1,24 @@
+import unittest
+from PySide import QtGui, QtUiTools
+from helper import adjust_filename
+from helper import TimedQApplication
+
+class Gui_Qt(QtGui.QMainWindow):
+ def __init__(self, parent=None):
+ super(Gui_Qt, self).__init__(parent)
+
+ lLoader = QtUiTools.QUiLoader()
+
+ # this used to cause a segfault because the old inject code used to destroy the parent layout
+ self._cw = lLoader.load(adjust_filename('bug_958.ui', __file__), self)
+
+ self.setCentralWidget(self._cw)
+
+class BugTest(TimedQApplication):
+ def testCase(self):
+ lMain = Gui_Qt()
+ lMain.show()
+ self.app.exec_()
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/tests/QtUiTools/bug_958.ui b/tests/QtUiTools/bug_958.ui
new file mode 100644
index 000000000..57cdbddba
--- /dev/null
+++ b/tests/QtUiTools/bug_958.ui
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>customWidget</class>
+ <widget class="QWidget" name="customWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>626</width>
+ <height>578</height>
+ </rect>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>500</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QTableWidget" name="resultTable"/>
+ </item>
+ <item>
+ <widget class="QProgressBar" name="progressBar">
+ <property name="value">
+ <number>0</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="actionLayout">
+ <item>
+ <widget class="QPushButton" name="processButton">
+ <property name="text">
+ <string>&amp;Berechnen</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>