Details
Description
Attempting to use QDomElement.setAttribute() with a value other than uint or str results in an OverflowError from libshiboken. This happens with python 3.6, 3.7 and 3.8 on both MacOs Catalina, and Linux. Qt version is 5.14.2 in both cases.
The attached program demonstrates the problem. The console displays:
% ./pyside2_setattribute_demo.py
./pyside2_setattribute_demo.py:16: RuntimeWarning: libshiboken: Overflow: Value -123 exceeds limits of type [unsigned] "j" (4bytes).
myelem.setAttribute("attr2", -123.45) # OverflowError
Traceback (most recent call last):
File "./pyside2_setattribute_demo.py", line 16, in <module>
myelem.setAttribute("attr2", -123.45) # OverflowError
OverflowError
It looks like float values are (incorrectly) cast to an int, and then Shiboken casts the int to an unsigned int and fails.
Changing the PySide2 import to PyQt5 allows the script to work as intended.