how to display the higlighted item within a list?

Post here if you need help with creating a Graphical User Interface in Python.

how to display the higlighted item within a list?

Postby salik89 » Mon Feb 03, 2014 2:17 pm

Hi all, I have a question.

How do I allow my listwidget to show the highlighted item upon execution? Currently for mine, it highlights the item but I have to scroll down everytime I execute my program to see if it is highlighting the correct item.. (My list items are very huge)

Code: Select all
    def currentItemSelect(self):
        currentItem = os.environ['ITEM']
           
        self.serverItemList.clearSelection()
           
        for item in self.serverItemList.findItems(currentItem, Qt.MatchFixedString):
            item.setSelected(True)
            serverItemList.scrollToItem(item)


I know that qlistwidget has a property/slot called scrollToItem and I strongly suspect that I have written wrong. Can someone advise me?
salik89
 
Posts: 13
Joined: Mon Jan 20, 2014 4:36 pm

Return to GUI

Who is online

Users browsing this forum: No registered users and 1 guest

cron