diff options
Diffstat (limited to 'sources/pyside6')
| -rw-r--r-- | sources/pyside6/PySide6/glue/qtcore.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sources/pyside6/PySide6/glue/qtcore.cpp b/sources/pyside6/PySide6/glue/qtcore.cpp index 5452e9f7f..05b4e7d2d 100644 --- a/sources/pyside6/PySide6/glue/qtcore.cpp +++ b/sources/pyside6/PySide6/glue/qtcore.cpp @@ -643,9 +643,10 @@ if (PyIndex_Check(_key)) { QByteArray temp; if (PyLong_Check(item)) { int overflow; - long ival = PyLong_AsLongAndOverflow(item, &overflow); - // Not suppose to bigger than 255 because only bytes, bytearray, QByteArray were accept - temp = QByteArray(reinterpret_cast<const char *>(&ival)); + const long ival = PyLong_AsLongAndOverflow(item, &overflow); + // Not supposed to be bigger than 255 because only bytes, + // bytearray, QByteArray were accepted + temp.append(char(ival)); } else { temp = %CONVERTTOCPP[QByteArray](item); } |
