I would take a look at QTableWidget instead of QTableView. For such a tableWidget:
def highlightResults(self, enteredText): for row in xrange(0, tableWidget.rowCount()): tableWidgetItem = tableWidget.item(row, 0) # Second argument is column if tableWidgetItem.text().contains(enteredText): tableWidgetItem.setBackground(QBrush(Qt.blue)) Also, connect the lineEdit's textChanged signal to the method above like this: lineEdit.textChanged.connect(self.highlightResults) On Tue, May 4, 2010 at 1:49 AM, AON LAZIO <aonla...@gmail.com> wrote: > Hi, > Suppose I want to search for some elements in QTableView when I type > into a lineedit box. How can I locate the item in the table (The table > direcly highlight the items searched if found) > Which method should I use? > Thanks in advance > > Aonlazio > > -- > Passion is my style > > _______________________________________________ > PyQt mailing list PyQt@riverbankcomputing.com > http://www.riverbankcomputing.com/mailman/listinfo/pyqt > -- Nick Gaens
_______________________________________________ PyQt mailing list PyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt