[PyQt] Selecting the last added item in a QAbstractTableModel
brianz at gmail.com
Thu Sep 9 06:04:28 BST 2010
You can do this with setCurrentIndex in the view. You'll simply need to
select an index in the row you just added.
In your case, it may be something like:
# assume you have a reference to the view and model
indx = self.model.index(len(fFlist) - 1, 0)
On Wed, Sep 8, 2010 at 3:52 PM, <AmFreak at web.de> wrote:
> i have a QAbstractTableModel in which i insert data (rows) with a button
> that opens a dialog and calls the insertRow method after the dialog is
> def insertRow (self, row, filesystem, parent = QModelIndex() ):
> self.beginInsertRows(QModelIndex(), len(self.fList),
> now the new data is added to the tableview and the view is sorted. But what
> bugs me is that the new row isn't selected (marked) - how can i do this ?
> PyQt mailing list PyQt at riverbankcomputing.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt