[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] PyQt Digest, Vol 139, Issue 6
From: Steve Waterbury <waterbug () pangalactic ! us>
Date: 2016-02-12 6:17:20
Message-ID: 56BD78F0.8010901 () pangalactic ! us
[Download RAW message or body]
On 02/05/2016 04:25 PM, David Cortesi wrote:
> From: Steve Waterbury <waterbug@pangalactic.us
> Any ideas on this one?
>
> > I'm using a QTableView with a QSortFilterProxyModel.
> > When I first instantiate and populate the
> > table view, I call resizeColumnToContents on each
> > column, followed by resizeRowsToContents on the table
> > view (there are some multi-line cells).
> >
> > However, the sizing to contents is lost when a sort is done
>
> You need to grab some signal that is emitted when the sort completes and
> the view has been completely repopulated with sorted data. (Sort
> indicator changed might not necessarily correspond to that.) My guess
> would be modelReset. I *think* the way the sort filter proxy works is,
> it tells the view, modelAboutToBeReset, then modelReset, which makes the
> view repopulate itself by calling the data() method of the model.
Seemed like a logical approach but doesn't work -- thanks anyway.
I guess I will have to implement the sort myself and refresh the
view. I'm rather surprised that Qt doesn't handle this rather
simple scenario!
Steve
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic