PDA

View Full Version : QTableWidget Standard Editor for double precision



pratham_shah
27th May 2013, 09:22
Hi,

I have a QTableWidget in which some fields are of type double.
Qt provides standard editor for double as QDoubleSpinBox which displays as 0.00
My problem is that I want to increase the decimal places to 7 like 0.0000000.
Is there any way to do it ?

I tried subclassing QDoubleSpinBox and used setDecimal(7) in constructor. I set this spin box as QItemEditor for my column (by means of delegates).
But then the max value is restricted 99.9999999.

ChrisW67
27th May 2013, 09:45
The documentation is your friend: QDoubleSpinBox::setMaximum()

pratham_shah
27th May 2013, 10:18
Thanks ..
But why was I not facing this problem when using the default ?
Also is there any other way apart from sub-classing ?