Results 1 to 2 of 2

Thread: Problem with updating a view after sorting a model

  1. #1
    Join Date
    Dec 2008
    Posts
    32
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    17

    Default Problem with updating a view after sorting a model

    I have a Model-View Application.

    Model represents a QList<QStringList> structure.
    in sort() function of model I swap the positions of items in QList<QStringList> but there is no refresh of the view - QTableView.

    Please help!

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

    Default Re: Problem with updating a view after sorting a model

    You have to emit a layoutChanged() signal after reordering items.

  3. The following user says thank you to wysota for this useful post:

    araglin (14th January 2009)

Similar Threads

  1. Help with Model View
    By weepdoo in forum Qt Programming
    Replies: 13
    Last Post: 12th October 2007, 11:32
  2. Graphics view display problem.
    By kiranraj in forum Qt Programming
    Replies: 3
    Last Post: 20th July 2007, 08:08
  3. Table Model / View Problem -- Data Not Displaying
    By jhendersen in forum Qt Programming
    Replies: 1
    Last Post: 22nd April 2007, 07:45
  4. Model sorting vs. selection
    By VlJE in forum Qt Programming
    Replies: 2
    Last Post: 25th October 2006, 17:46
  5. Replies: 6
    Last Post: 20th April 2006, 11:23

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.