Results 1 to 4 of 4

Thread: QTableView refresh problem

  1. #1
    Join Date
    Dec 2006
    Posts
    9
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy QTableView refresh problem

    Hi;

    How can refresh TableView after remove a row.

    Qt Code:
    1. model->removeRow(row);
    To copy to clipboard, switch view to plain text mode 

    delete row from model but data stay on the TableView
    if use select() again before submitAll() to disappear new inserted record
    how can refresh it.

    Please help...

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

    Default Re: QTableView refresh problem

    What kind of model did you use? QSqlQueryModel is read-only - you can't remove rows from it. If you implemented removeRows() yourself, you have to use beginRemoveRows() and endRemoveRows() to make sure views get refreshed.

  3. #3
    Join Date
    Dec 2006
    Posts
    9
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Re: QTableView refresh problem

    I understand the problem...

    [HTML]http://lists.trolltech.com/qt-interest/2005-09/thread00510-0.html[/HTML]

    but now, i have another problem;

    how can learn record state (inserted, updated or deleted) from QSqlTableModel


    thank you...

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

    Default Re: QTableView refresh problem

    What do you mean by "record state"? If you submit all changes to the model, operations will be comitted and your model will get updated.

Similar Threads

  1. QTreeView problem scrolling to end.
    By seneca in forum Qt Programming
    Replies: 7
    Last Post: 22nd December 2015, 12:08
  2. Replies: 9
    Last Post: 7th November 2006, 15:10
  3. QTableView paints too much
    By Jimmy2775 in forum Qt Programming
    Replies: 2
    Last Post: 26th July 2006, 18:42
  4. Multi-line messages in QTableView
    By Conel in forum Qt Programming
    Replies: 6
    Last Post: 13th April 2006, 13:49
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.