summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-10-28 17:32:33 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2010-10-28 17:33:33 -0200
commita1524b78b632d99aa6076391d0d77e46271dd7c8 (patch)
treeb8c057c756bdb5fa5b60bf164f2dd37b8b5125e9
parent22eab45ac999b03e2f30d2cf769d3f36450a05cb (diff)
downloadpyside-a1524b78b632d99aa6076391d0d77e46271dd7c8.tar.gz
pyside-a1524b78b632d99aa6076391d0d77e46271dd7c8.tar.xz
pyside-a1524b78b632d99aa6076391d0d77e46271dd7c8.zip
Fix bug#409 - "function -- PySide.QtUiTools.QUiLoader.load(...) -- takes bytes-string (but not unicode-string)"
Reviewer: Renato Ara├║jo <renato.filho@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
-rw-r--r--PySide/QtUiTools/typesystem_uitools.xml2
-rw-r--r--tests/QtUiTools/uiloader_test.py13
2 files changed, 14 insertions, 1 deletions
diff --git a/PySide/QtUiTools/typesystem_uitools.xml b/PySide/QtUiTools/typesystem_uitools.xml
index 82acb04..2f94f21 100644
--- a/PySide/QtUiTools/typesystem_uitools.xml
+++ b/PySide/QtUiTools/typesystem_uitools.xml
@@ -77,7 +77,7 @@
</modify-function>
<!-- Syntax sugar -->
- <add-function signature="load(const char*, QWidget*)" return-type="QWidget*">
+ <add-function signature="load(QString, QWidget*)" return-type="QWidget*">
<extra-includes>
<include file-name="glue/uitools_loadui.h" location="local"/>
</extra-includes>
diff --git a/tests/QtUiTools/uiloader_test.py b/tests/QtUiTools/uiloader_test.py
index fe3725b..0b397a0 100644
--- a/tests/QtUiTools/uiloader_test.py
+++ b/tests/QtUiTools/uiloader_test.py
@@ -25,6 +25,19 @@ class QUioaderTeste(UsesQApplication):
self.assertNotEqual(child, None)
self.assertEqual(w.findChild(QWidget, "grandson_object"), child.findChild(QWidget, "grandson_object"))
+ def testLoadFileUnicodeFilePath(self):
+ filePath = unicode(os.path.join(os.path.dirname(__file__), 'test.ui'))
+ loader = QUiLoader()
+ parent = QWidget()
+ w = loader.load(filePath, parent)
+ self.assertNotEqual(w, None)
+
+ self.assertEqual(len(parent.children()), 1)
+
+ child = w.findChild(QWidget, "child_object")
+ self.assertNotEqual(child, None)
+ self.assertEqual(w.findChild(QWidget, "grandson_object"), child.findChild(QWidget, "grandson_object"))
+
if __name__ == '__main__':
unittest.main()