Results 1 to 2 of 2

Thread: QSqlTableModel Insert Column Sum at the end of the model or table.

  1. #1
    Join Date
    Jan 2007
    Posts
    201
    Thanks
    22
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default QSqlTableModel Insert Column Sum at the end of the model or table.

    Dear All

    We have lots of QSqlTabelModel's that has double values in some columns. What we normaly to is to make a second query and have the sum of the column. What we would like to do is make it without a second query. Is it possible to calculate the of a column in model and after that insert it into bottom of the query.

    Waiting for your reply!!!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QSqlTableModel Insert Column Sum at the end of the model or table.

    Yes, you can subclass the model and add an additional entry to the model or implement a proxy model that will do that if you don't want to pollute the original model.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 15
    Last Post: 8th June 2013, 07:15
  2. Replies: 0
    Last Post: 9th December 2010, 15:53
  3. Replies: 0
    Last Post: 17th September 2010, 13:19
  4. Insert into array column
    By wirasto in forum Newbie
    Replies: 3
    Last Post: 9th November 2009, 16:07
  5. Sum of a column in QSqlTableModel
    By giusepped in forum Qt Programming
    Replies: 4
    Last Post: 11th November 2008, 00:38

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.