[PyQt] QDoubleSpinBox & it's precision

Baz Walter bazwal at ftml.net
Sat Oct 10 12:46:49 BST 2009


Prashant Saxena wrote:
> I am initializing spinBox with value (0.421), what I am getting is (0.42).
> Third decimal precision is getting disappeared. I need exact value in spin box.

the value of QDoubleSpinBox.decimals() defaults to 2.

you need to call setDecimals(3) *before* you call setValue(0.421).

HTH



More information about the PyQt mailing list