summaryrefslogtreecommitdiffstats
path: root/tests/QtUiTools
diff options
context:
space:
mode:
Diffstat (limited to 'tests/QtUiTools')
-rw-r--r--tests/QtUiTools/CMakeLists.txt1
-rw-r--r--tests/QtUiTools/bug_1135.py29
-rw-r--r--tests/QtUiTools/bug_1135.ui65
3 files changed, 95 insertions, 0 deletions
diff --git a/tests/QtUiTools/CMakeLists.txt b/tests/QtUiTools/CMakeLists.txt
index 39e2e94..f187581 100644
--- a/tests/QtUiTools/CMakeLists.txt
+++ b/tests/QtUiTools/CMakeLists.txt
@@ -9,6 +9,7 @@ PYSIDE_TEST(bug_913.py)
PYSIDE_TEST(bug_958.py)
PYSIDE_TEST(bug_965.py)
PYSIDE_TEST(bug_1060.py)
+PYSIDE_TEST(bug_1135.py)
PYSIDE_TEST(bug_1138.py)
PYSIDE_TEST(uiloader_test.py)
PYSIDE_TEST(ui_test.py)
diff --git a/tests/QtUiTools/bug_1135.py b/tests/QtUiTools/bug_1135.py
new file mode 100644
index 0000000..4a82413
--- /dev/null
+++ b/tests/QtUiTools/bug_1135.py
@@ -0,0 +1,29 @@
+''' unit test for BUG #1135 '''
+''' see http://bugs.pyside.org/show_bug.cgi?id=1135 '''
+
+from PySide.QtCore import *
+from PySide.QtGui import *
+from PySide.QtUiTools import QUiLoader
+from helper import adjust_filename
+
+class CustomWidget(QFrame):
+ def __init__(self, parent=None):
+ super(CustomWidget, self).__init__(parent)
+ self.layout = QVBoxLayout()
+ self.label = QLabel("Custom widget")
+ self.layout.addWidget(self.label)
+ self.setLayout(self.layout)
+
+class CustomLoader(QUiLoader):
+ def __init__(self):
+ super(CustomLoader,self).__init__()
+
+ def createWidget(self, className, parent=None, name=""):
+ return super(CustomLoader, self).createWidget(className, parent, name)
+
+if __name__ == "__main__":
+ app = QApplication([])
+ loader = CustomLoader()
+ loader.registerCustomWidget(CustomWidget)
+ form = loader.load(adjust_filename("bug_1135.ui", __file__))
+ form.show()
diff --git a/tests/QtUiTools/bug_1135.ui b/tests/QtUiTools/bug_1135.ui
new file mode 100644
index 0000000..539fc17
--- /dev/null
+++ b/tests/QtUiTools/bug_1135.ui
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Dialog</class>
+ <widget class="QDialog" name="Dialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Dialog</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QScrollArea" name="scrollArea">
+ <property name="widgetResizable">
+ <bool>true</bool>
+ </property>
+ <widget class="QWidget" name="scrollAreaWidgetContents">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>380</width>
+ <height>280</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QPushButton" name="pushButton">
+ <property name="text">
+ <string>Regular widget</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="CustomWidget" name="frame">
+ <property name="frameShape">
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Raised</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>CustomWidget</class>
+ <extends>QFrame</extends>
+ <header>customwidget.h</header>
+ <container>1</container>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>