From 44998fd471927efb8c7a55e5bd7b81bad9f6e876 Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Fri, 4 Feb 2011 18:24:07 -0200 Subject: Fix 666 - "QByteArray does not support slices" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewer: Renato Araújo Marcelo Lira --- PySide/QtCore/typesystem_core.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'PySide/QtCore') diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml index 8e292cf18..0cc5b2f4c 100644 --- a/PySide/QtCore/typesystem_core.xml +++ b/PySide/QtCore/typesystem_core.xml @@ -1811,6 +1811,17 @@ return !result ? -1 : 0; + + + Py_ssize_t max = %CPPSELF.count(); + _i1 = qBound(Py_ssize_t(0), _i1, max); + _i2 = qBound(Py_ssize_t(0), _i2, max); + + if (_i1 >= _i2) + return %CONVERTTOPYTHON[QByteArray](QByteArray()); + return %CONVERTTOPYTHON[QByteArray](%CPPSELF.mid(_i1, _i2 - _i1)); + + -- cgit v1.2.3