diff options
-rw-r--r-- | PySide/QtCore/typesystem_core.xml | 10 | ||||
-rw-r--r-- | tests/QtCore/qbytearray_test.py | 7 |
2 files changed, 16 insertions, 1 deletions
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml index e416e575a..c785f797d 100644 --- a/PySide/QtCore/typesystem_core.xml +++ b/PySide/QtCore/typesystem_core.xml @@ -1734,7 +1734,15 @@ <modify-argument index="0" replace-value="this"/> </modify-function> <modify-function signature="startsWith(const char *)const" remove="all"/> - <modify-function signature="fromRawData(const char*,int)" remove="all"/> + <modify-function signature="fromRawData(const char*,int)"> + <modify-argument index="2"> + <remove-argument /> + </modify-argument> + <inject-code class="target"> + // %FUNCTION_NAME() - avoid generation of default function call + %PYARG_0 = %CONVERTTOPYTHON[QByteArray](QByteArray(%1)); + </inject-code> + </modify-function> <modify-function signature="number(int,int)"> <rename to="fromInt"/> </modify-function> diff --git a/tests/QtCore/qbytearray_test.py b/tests/QtCore/qbytearray_test.py index 2c0ee87ce..34dc42f57 100644 --- a/tests/QtCore/qbytearray_test.py +++ b/tests/QtCore/qbytearray_test.py @@ -102,5 +102,12 @@ class QByteArrayOnQVariant(unittest.TestCase): a = QSettings().value("some_prop", QByteArray()) self.assertEqual(type(a), QByteArray) +class QByteArrayBug514(unittest.TestCase): + def testIt(self): + data = "foobar" + a = QByteArray.fromRawData(data) + self.assertEqual(type(a), QByteArray) + self.assertEqual(a.data(), data) + if __name__ == '__main__': unittest.main() |