You can do this with setCurrentIndex in the view. You'll simply need to select an index in the row you just added.
http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qabstractitemview.html#setCurrentIndex In your case, it may be something like: # assume you have a reference to the view and model self.model.insertRow(stuff) indx = self.model.index(len(fFlist) - 1, 0) self.view.setCurrentIndex(indx) BZ On Wed, Sep 8, 2010 at 3:52 PM, <[email protected]> wrote: > Hi, > > 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 > closed: > > def insertRow (self, row, filesystem, parent = QModelIndex() ): > self.beginInsertRows(QModelIndex(), len(self.fList), > len(self.fList)) > self.fList.append(filesystem) > self.endInsertRows() > > 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 ? > > > Greetings > > AmFreak > _______________________________________________ > PyQt mailing list [email protected] > http://www.riverbankcomputing.com/mailman/listinfo/pyqt >
_______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
