summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Alcantara <pcacjr@gmail.com>2011-12-21 18:51:34 -0300
committerPaulo Alcantara <pcacjr@gmail.com>2011-12-21 19:17:08 -0300
commitace1372c1a091faabdc6cfb00f187a993d31b2c4 (patch)
tree59f3f60050292173317c7eb2f556fc8a6ff58e5f
parent689c31a3634e7266343ff475e82236bd7d6611a9 (diff)
downloadpyside-ace1372c1a091faabdc6cfb00f187a993d31b2c4.tar.gz
pyside-ace1372c1a091faabdc6cfb00f187a993d31b2c4.tar.xz
pyside-ace1372c1a091faabdc6cfb00f187a993d31b2c4.zip
Fix BUG #1060 - "Subclassing of QUiLoader leads to "Internal C++ object
already deleted" exception" See http://bugs.pyside.org/show_bug.cgi?id=1060. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com> Reviewed-by: Marcelo Lira <marcelo.lira@openbossa.org>
-rw-r--r--PySide/QtUiTools/typesystem_uitools.xml11
-rw-r--r--tests/QtUiTools/CMakeLists.txt1
-rw-r--r--tests/QtUiTools/bug_1060.py18
-rw-r--r--tests/QtUiTools/bug_1060.ui19
4 files changed, 44 insertions, 5 deletions
diff --git a/PySide/QtUiTools/typesystem_uitools.xml b/PySide/QtUiTools/typesystem_uitools.xml
index c86ae44..08e98bd 100644
--- a/PySide/QtUiTools/typesystem_uitools.xml
+++ b/PySide/QtUiTools/typesystem_uitools.xml
@@ -70,27 +70,28 @@
%CPPSELF.addPluginPath(""); // force reload widgets
</inject-code>
</add-function>
- <modify-function signature="createAction(QObject *, const QString&amp;)">
+ <modify-function signature="createAction(QObject*, const QString&amp;)">
<modify-argument index="return">
<parent index="1" action="add"/>
</modify-argument>
</modify-function>
- <modify-function signature="createActionGroup(QObject *, const QString&amp;)">
+ <modify-function signature="createActionGroup(QObject*, const QString&amp;)">
<modify-argument index="return">
<parent index="1" action="add"/>
</modify-argument>
</modify-function>
- <modify-function signature="createLayout(const QString&amp;,QObject *, const QString&amp;)">
+ <modify-function signature="createLayout(const QString&amp;, QObject*, const QString&amp;)">
<modify-argument index="return">
<parent index="2" action="add"/>
</modify-argument>
</modify-function>
- <modify-function signature="createWidget(const QString&amp;,QWidget*, const QString&amp;)">
+ <modify-function signature="createWidget(const QString&amp;, QWidget*, const QString&amp;)">
<modify-argument index="return">
- <parent index="2" action="add"/>
+ <parent index="2" action="add"/>
+ <define-ownership class="target" owner="default"/>
</modify-argument>
</modify-function>
diff --git a/tests/QtUiTools/CMakeLists.txt b/tests/QtUiTools/CMakeLists.txt
index eecf3df..68ed7f1 100644
--- a/tests/QtUiTools/CMakeLists.txt
+++ b/tests/QtUiTools/CMakeLists.txt
@@ -8,5 +8,6 @@ PYSIDE_TEST(bug_909.py)
PYSIDE_TEST(bug_913.py)
PYSIDE_TEST(bug_958.py)
PYSIDE_TEST(bug_965.py)
+PYSIDE_TEST(bug_1060.py)
PYSIDE_TEST(uiloader_test.py)
PYSIDE_TEST(ui_test.py)
diff --git a/tests/QtUiTools/bug_1060.py b/tests/QtUiTools/bug_1060.py
new file mode 100644
index 0000000..8b51501
--- /dev/null
+++ b/tests/QtUiTools/bug_1060.py
@@ -0,0 +1,18 @@
+''' unit test for BUG #1060 '''
+
+from PySide.QtGui import QApplication
+from PySide.QtUiTools import QUiLoader
+from helper import adjust_filename
+
+class MyQUiLoader(QUiLoader):
+ def __init__(self):
+ super(MyQUiLoader, self).__init__()
+
+ def createWidget(self, *args):
+ return super(MyQUiLoader, self).createWidget(*args)
+
+if __name__ == "__main__":
+ app = QApplication([])
+
+ ui = MyQUiLoader().load(adjust_filename("bug_1060.ui", __file__))
+ ui.show()
diff --git a/tests/QtUiTools/bug_1060.ui b/tests/QtUiTools/bug_1060.ui
new file mode 100644
index 0000000..f4044a8
--- /dev/null
+++ b/tests/QtUiTools/bug_1060.ui
@@ -0,0 +1,19 @@
+<?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>100</width>
+ <height>100</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Dialog</string>
+ </property>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>