[Qt-interest] QTableView is not updated after sort (Qt 4.6 Windows)
anders.bakken at nokia.com
anders.bakken at nokia.com
Tue Jan 12 06:04:20 CET 2010
Glad to be able to help.
That's probably a good idea.
Anders
________________________________________
From: ext Smokey McPott [mailslave3000 at googlemail.com]
Sent: Monday, January 11, 2010 8:24 PM
To: Bakken Anders (Nokia-D-Qt/RedwoodCity)
Cc: qt-interest at trolltech.com
Subject: Re: [Qt-interest] QTableView is not updated after sort (Qt 4.6 Windows)
Thanks that did the trick.I found no info on that in the documentation. Should I submit a bug report? They could either update the documentation or change the sort routine in QTableView.
Smokey
2010/1/11 <anders.bakken at nokia.com<mailto:anders.bakken at nokia.com>>
You likely need to emit layoutchanged at the end of sort. Remember to
update the persistent model indexes as well.
--
Anders
On Jan 9, 2010, at 5:26 AM, "ext Smokey McPott" <mailslave3000 at googlemail.com<mailto:mailslave3000 at googlemail.com>
> wrote:
> Hey people,
>
> I've written a widget that contains a QTableView which has sorting
> enabled. Now, when I click the header, the sort function of the
> model is called but the view is not updated. When the view gets
> repainted, e.g. because I minimize the application and bring it up
> again, the data are shown in the desired (updated) way. I've
> observed the same behaviour in Qt 4.5 but I couldn'd find any posts
> on the subject. In the source code for QTableView most functions
> that change the contents of the view call d->viewport->upate() or d-
> >viewport->upate(rect). But the sortByColumn(int column) function
> lacks a similar call. Bug or feature?
>
> Regards
> Sebastian
>
> <ATT00001..txt>
More information about the Qt-interest-old
mailing list