aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sources/pyside6/PySide6/glue/qtcore.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/sources/pyside6/PySide6/glue/qtcore.cpp b/sources/pyside6/PySide6/glue/qtcore.cpp
index 13cc1727c..218b2d698 100644
--- a/sources/pyside6/PySide6/glue/qtcore.cpp
+++ b/sources/pyside6/PySide6/glue/qtcore.cpp
@@ -1059,9 +1059,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);
}