From ace1372c1a091faabdc6cfb00f187a993d31b2c4 Mon Sep 17 00:00:00 2001 From: Paulo Alcantara Date: Wed, 21 Dec 2011 18:51:34 -0300 Subject: 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 Reviewed-by: Marcelo Lira --- tests/QtUiTools/CMakeLists.txt | 1 + tests/QtUiTools/bug_1060.py | 18 ++++++++++++++++++ tests/QtUiTools/bug_1060.ui | 19 +++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 tests/QtUiTools/bug_1060.py create mode 100644 tests/QtUiTools/bug_1060.ui (limited to 'tests/QtUiTools') 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 @@ + + + Dialog + + + + 0 + 0 + 100 + 100 + + + + Dialog + + + + + -- cgit