[PyQt] Maintaining index after sort
mrossi19 at gmail.com
Tue May 31 15:00:57 BST 2011
You actually provided me the answer. Was not aware of proxy models but once
I added the QSortFilterProxyModel (as shown in the pyqt example) everything
On Mon, May 30, 2011 at 1:54 PM, Andreas Pakulat <apaku at gmx.de> wrote:
> On 29.05.11 15:06:17, Marc Rossi wrote:
> > Thanks for the reply. There must be some core concept of Qt/Model-View
> > programming I am just missing.
> > Makes sense that I can store the data keyed by symbol in the model and
> > update it that way, but I thought I had to emit a dataChanged signal for
> > view to update as shown below:
> > self.emit(SIGNAL("dataChanged(QModelIndex,QModelIndex)"),
> > self.index(index.row(), COL1), self.index(index.row(), COL5))
> > Doing it this way required me to have the index for the column I wanted
> > refreshed. I see there is a 'match()' function in the
> > class but when I tried that (calling match for every update) things were
> > ridiculously slow.
> Hmm, I don't have that much experience with sorting without a proxy
> model between the real one and the view, but if the model does not get
> notified about changes in its indexes then that sounds like a there's a
> bug somewhere.
> PyQt mailing list PyQt at riverbankcomputing.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt