Results 1 to 3 of 3

Thread: QTableWidget Standard Editor for double precision

  1. #1
    Join Date
    Mar 2012
    Location
    India
    Posts
    22
    Thanks
    3
    Qt products
    Qt4

    Default QTableWidget Standard Editor for double precision

    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.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QTableWidget Standard Editor for double precision

    The documentation is your friend: QDoubleSpinBox::setMaximum()

  3. #3
    Join Date
    Mar 2012
    Location
    India
    Posts
    22
    Thanks
    3
    Qt products
    Qt4

    Default Re: QTableWidget Standard Editor for double precision

    Thanks ..
    But why was I not facing this problem when using the default ?
    Also is there any other way apart from sub-classing ?
    Last edited by pratham_shah; 27th May 2013 at 09:26.

Similar Threads

  1. how to set double precision
    By saman_artorious in forum Qt Programming
    Replies: 4
    Last Post: 28th February 2013, 00:48
  2. Replies: 7
    Last Post: 28th December 2010, 20:27
  3. Replies: 1
    Last Post: 19th May 2010, 04:24
  4. The precision range of double
    By nikhilqt in forum Qt Programming
    Replies: 14
    Last Post: 8th July 2009, 15:08
  5. double precision or what?
    By mickey in forum General Programming
    Replies: 7
    Last Post: 20th February 2007, 20:01

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.