Results 1 to 3 of 3

Thread: Slow update in QAbstractTableModel in setData

  1. #1
    Join Date
    Oct 2008
    Location
    Germany
    Posts
    29
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Slow update in QAbstractTableModel in setData

    Hi,

    I created my own table model which fetches data from a database. After I call emit dataChanged(index,index) the model updates all table cells, which takes very long for all the records.
    Is it possible to only "refresh" the updated cell or is there any other way to get better performance for this?

  2. #2
    Join Date
    Apr 2010
    Posts
    98
    Thanks
    19
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Slow update in QAbstractTableModel in setData

    I don't understand,shouldn't dataChanged(index1,index2) only affects those indices between index1 and index2?
    Last edited by MorrisLiang; 20th May 2010 at 13:58.
    It's not the goodbye that hurts,but the flashback that follow.

  3. #3
    Join Date
    Oct 2008
    Location
    Germany
    Posts
    29
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Slow update in QAbstractTableModel in setData

    That's what I thought. But it re-fetches all the data from the database.

Similar Threads

  1. SQL slow query - table update
    By lasher in forum Newbie
    Replies: 4
    Last Post: 21st October 2009, 23:12
  2. QSqlTableModel and possible bug with setData?
    By sylvainb in forum Qt Programming
    Replies: 2
    Last Post: 25th February 2009, 21:43
  3. setData()
    By starcontrol in forum Qt Programming
    Replies: 2
    Last Post: 2nd May 2008, 08:54
  4. setData()
    By coderbob in forum Qt Programming
    Replies: 4
    Last Post: 28th February 2008, 12:51
  5. QTableWidget Update - slow
    By DPinLV in forum Qt Programming
    Replies: 16
    Last Post: 18th August 2006, 21:09

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
  •  
Qt is a trademark of The Qt Company.