PyQt6: QLocale.FloatingPointPrecisionOption should be an IntEnum
Phil Thompson
phil at riverbankcomputing.com
Tue Feb 1 10:17:38 GMT 2022
On 31/01/2022 12:31, Ales Erjavec wrote:
> 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))
> ```
Fixed in the next release.
Thanks,
Phil
More information about the PyQt
mailing list