Results 1 to 6 of 6

Thread: Refreshing QDataTable

  1. #1
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Refreshing QDataTable

    Hi all!
    Can i refresh only changed records of QDataTable?
    a life without programming is like an empty bottle

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Refreshing QDataTable

    How would you find out whether the record was changed?

  3. #3
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: Refreshing QDataTable

    I mean changing that user do own by editing some record in data table..

    Ok i think my question has poor info for good understanding. I'll try correct that
    So i have read only data table with 1000 records. For editing record i create new dialog, and after user press "Ok" i do dataTable->refresh(). I want refresh only some edited cell , but i see that my data table has full refresh The same thing hapend when i add or delete row..What i missed
    Last edited by zlatko; 2nd May 2006 at 15:22.
    a life without programming is like an empty bottle

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Refreshing QDataTable

    Do you use QSqlSelectCursor with this QDataTable?

  5. #5
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: Refreshing QDataTable

    yes..........
    a life without programming is like an empty bottle

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Refreshing QDataTable

    Well... you can't do this directly because QSqlSelectCursor is read-only, but QDataTable inherits QTable, so you could try to hack it using QTable methods or you can implement your own QSqlCursor subclass.

    Another solution is to use QTable and fill it with data by hand.

    Anyway, if your program uses a database, then probably more than one person will be using it at the same time. In such case you would want to refresh the data from time to time, so a refresh after adding a record won't be so bad (unless you have a really complex query).

  7. The following user says thank you to jacek for this useful post:

    zlatko (2nd May 2006)

Similar Threads

  1. qdatatable problem..
    By triperzonak in forum Qt Programming
    Replies: 1
    Last Post: 28th July 2008, 14:50
  2. Qt4 - QSqlQueryModel x Qt3 QDataTable
    By ederbs in forum Qt Programming
    Replies: 3
    Last Post: 10th September 2007, 07:38
  3. QDataTable to bloquer modified value
    By cristiano in forum Qt Programming
    Replies: 5
    Last Post: 17th January 2007, 00:58
  4. Refresh QDataTable
    By shamik in forum Qt Programming
    Replies: 25
    Last Post: 1st December 2006, 05:04
  5. displaying any table on a qdatatable
    By Philip_Anselmo in forum Newbie
    Replies: 4
    Last Post: 9th May 2006, 22:12

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.