Permalink
Browse files

Automatically select the item under the mouse for visual feedback

  • Loading branch information...
1 parent 62ffdb9 commit 20d97cce2991cbcffd28b32cf9d0bf67b592bee2 @ijanos committed Dec 29, 2011
Showing with 9 additions and 0 deletions.
  1. +9 −0 widgets/taglistwidget.py
View
9 widgets/taglistwidget.py
@@ -35,11 +35,20 @@ class MyTaglistWidget(QListWidget):
def __init__(self, parent=None):
QListWidget.__init__(self, parent)
self.setAlternatingRowColors(True)
+
+ self.setMouseTracking(True)
+
+ self.connect(self, SIGNAL('itemEntered (QListWidgetItem *)'),
+ self.selectOnHover)
+
self.connect(self, SIGNAL('itemClicked (QListWidgetItem *)'),
self.clicked)
self.sortByWeight = True
+ def selectOnHover(self, item):
+ self.setItemSelected(item, True)
+
def clicked(self, item):
self.emit(SIGNAL('tagClicked'), item._tagid, item._name)

0 comments on commit 20d97cc

Please sign in to comment.