[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: PyQt6: QLocale.FloatingPointPrecisionOption should be an IntEnum
From: Ales Erjavec <ales.erjavec324 () gmail ! com>
Date: 2022-01-31 12:31:32
Message-ID: CAAHyjafU6_yzv6E39NRT6=X+ZHqnSTLph7kFds0LPcUQN37EvA () mail ! gmail ! com
[Download RAW message or body]
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.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic