Results 1 to 2 of 2

Thread: Displaying QSqlRecords on QTableWidget (double precision problems)...

  1. #1
    Join Date
    Apr 2007
    Location
    Brazil
    Posts
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default Displaying QSqlRecords on QTableWidget (double precision problems)...

    Hello All,

    I'm sorry if this is such a novice problem, but I'm having really trouble wiht it.

    My application executes database operations by using a separated thread, instead using the main thread. I read several comments about sharing data to different threads, so I decided to use a signal-slot mechanism to transfer a QList<QSqlRecord> from one thread to other.

    When the other thread receives the record list, it stores the records (variant values) into a QTableWidget. The problem is that QTableWidget is not displaying the correct precision of doubles.

    I have a previous application where I don't use threads, so I just set a QSqlQueryModel to a QTableView and all numeric values are correctly displayed.

    Is there any simple solution to this problem?

    Regards,
    Antonio Menezes.

  2. #2
    Join Date
    Apr 2007
    Location
    Brazil
    Posts
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: Displaying QSqlRecords on QTableWidget (double precision problems)...

    Hello!

    Just to say I found a solution. I've used the setNumericalPrecisionPolicy method of QSqlDatabase. I guess in Qt 4.6.2 the default is not QSql::HighPrecision.

    Reference: http://comments.gmane.org/gmane.comp....general/30819

    Regards,
    Antonio Menezes.

Similar Threads

  1. Replies: 7
    Last Post: 28th December 2010, 20:27
  2. sortItems by double value in QTableWidget
    By wconstan in forum Newbie
    Replies: 4
    Last Post: 27th December 2009, 18:20
  3. The precision range of double
    By nikhilqt in forum Qt Programming
    Replies: 14
    Last Post: 8th July 2009, 15:08
  4. Replies: 1
    Last Post: 24th July 2008, 18:20
  5. double precision or what?
    By mickey in forum General Programming
    Replies: 7
    Last Post: 20th February 2007, 20:01

Tags for this Thread

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.