aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--PySide/QtCore/typesystem_core.xml6
-rw-r--r--tests/QtCore/qbytearray_test.py6
2 files changed, 12 insertions, 0 deletions
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index f5216073f..e542ea693 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1437,6 +1437,12 @@
#endif
</inject-code>
+ <modify-function signature="data()const">
+ <inject-code class="target" position="beginning">
+ %PYARG_0 = PyString_FromStringAndSize(%CPPSELF.%FUNCTION_NAME(), %CPPSELF.size());
+ </inject-code>
+ </modify-function>
+
<!-- removed functions -->
<modify-function signature="begin()" remove="all"/>
<modify-function signature="begin()const" remove="all"/>
diff --git a/tests/QtCore/qbytearray_test.py b/tests/QtCore/qbytearray_test.py
index 1c425b8e9..2c0ee87ce 100644
--- a/tests/QtCore/qbytearray_test.py
+++ b/tests/QtCore/qbytearray_test.py
@@ -42,6 +42,12 @@ class QByteArrayData(unittest.TestCase):
url = QByteArray("http://web.openbossa.org/")
self.assertEqual(url.data(), "http://web.openbossa.org/")
+ def testDataWithZeros(self):
+ s1 = "123\000321"
+ ba = QByteArray(s1)
+ s2 = ba.data()
+ self.assertEqual(s1, s2)
+
class QByteArrayOperatorAtSetter(unittest.TestCase):
'''Test case for operator QByteArray[] - __setitem__'''