def mouseMoveEvent(self, ev): idx = self.indexAt(ev.pos()) if idx.isValid(): ci = self.currentIndex() if idx.row() != ci.row(): self.setCurrentIndex(idx) return QListView.mouseMoveEvent(self, ev)
def mouseMoveEvent(self, ev): index = self.indexAt(ev.pos()) if index.isValid(): row = index.row() if row != self.last_mouse_idx: self.last_mouse_idx = row try: char_code = int(self.model().data(index, Qt.UserRole)) except (TypeError, ValueError): pass else: self.show_name.emit(char_code) self.setCursor(Qt.PointingHandCursor) else: self.setCursor(Qt.ArrowCursor) self.show_name.emit(-1) self.last_mouse_idx = -1 return QListView.mouseMoveEvent(self, ev)