From f3d69f65d18b641aeeedfbbfe8a0e16d2a75d9fe Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Mon, 4 Jul 2011 18:29:46 -0300 Subject: Fix bug 913 - "Widgets inside QTabWidget are not exported as members of the containing widget" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewer: Marcelo Lira Renato Araújo --- tests/QtUiTools/CMakeLists.txt | 1 + tests/QtUiTools/bug_392.py | 2 +- tests/QtUiTools/bug_913.py | 23 +++++++++++++++++ tests/QtUiTools/bug_913.ui | 57 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 tests/QtUiTools/bug_913.py create mode 100644 tests/QtUiTools/bug_913.ui (limited to 'tests/QtUiTools') diff --git a/tests/QtUiTools/CMakeLists.txt b/tests/QtUiTools/CMakeLists.txt index 02fb89dd4..9acc9f35d 100644 --- a/tests/QtUiTools/CMakeLists.txt +++ b/tests/QtUiTools/CMakeLists.txt @@ -5,5 +5,6 @@ PYSIDE_TEST(bug_426.py) PYSIDE_TEST(bug_552.py) PYSIDE_TEST(bug_797.py) PYSIDE_TEST(bug_909.py) +PYSIDE_TEST(bug_913.py) PYSIDE_TEST(uiloader_test.py) PYSIDE_TEST(ui_test.py) diff --git a/tests/QtUiTools/bug_392.py b/tests/QtUiTools/bug_392.py index 69817ff9f..c6e751f41 100644 --- a/tests/QtUiTools/bug_392.py +++ b/tests/QtUiTools/bug_392.py @@ -19,7 +19,7 @@ class BugTest(UsesQApplication): filePath = os.path.join(os.path.dirname(__file__), 'action.ui') result = loader.load(filePath, w) - self.assert_(isinstance(result.statusbar.actionFoo, QtGui.QAction)) + self.assert_(isinstance(result.actionFoo, QtGui.QAction)) def testPythonCustomWidgets(self): w = QtGui.QWidget() diff --git a/tests/QtUiTools/bug_913.py b/tests/QtUiTools/bug_913.py new file mode 100644 index 000000000..f42ce4a12 --- /dev/null +++ b/tests/QtUiTools/bug_913.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import sys +import unittest +from helper import adjust_filename + +from PySide.QtCore import * +from PySide.QtGui import * +from PySide.QtUiTools import * + +class TestBug913 (unittest.TestCase): + + def testIt(self): + app = QApplication([]) + + loader = QUiLoader() + widget = loader.load(adjust_filename('bug_913.ui', __file__)) + widget.tabWidget.currentIndex() # direct child is available as member + widget.le_first.setText('foo') # child of QTabWidget must also be available! + +if __name__ == '__main__': + unittest.main() diff --git a/tests/QtUiTools/bug_913.ui b/tests/QtUiTools/bug_913.ui new file mode 100644 index 000000000..0fc95fd53 --- /dev/null +++ b/tests/QtUiTools/bug_913.ui @@ -0,0 +1,57 @@ + + + Form + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + + + Tab 1 + + + + + + First name: + + + + + + + + + + Last name: + + + + + + + + + + + Tab 2 + + + + + + + + + -- cgit v1.2.3