PyQt6: QLocale.FloatingPointPrecisionOption should be an IntEnum

Ales Erjavec ales.erjavec324 at gmail.com
Mon Jan 31 12:31:32 GMT 2022


Hi,

QLocale.FloatingPointPrecisionOption
(https://doc.qt.io/qt-5/qlocale.html#FloatingPointPrecisionOption-enum)
cannot be used in PyQt6. It is specifically defined to be integer
constants to be used in APIs taking `int precision` arguments, but in
PyQt6 it is a plain enum and as such is is not cast-able to int.

```
from PyQt6.QtCore import QLocale

c = QLocale.c()
print(c.toString(0.3, "f",
QLocale.FloatingPointPrecisionOption.FloatingPointShortest))
```

Thanks.


More information about the PyQt mailing list