Exemple #1
0
 def mouseReleaseEvent(self, ev):
     item = self.itemAt(self._mouse_press_pos)
     if item:
         col = self.header().logicalIndexAt(self._mouse_press_pos)
     # pass event to parent
     QTreeWidget.mouseReleaseEvent(self, ev)
     # now see if the item was expanded or collapsed because of the event. Only emit signal if this was
     # not the case (i.e. swallow the clicks that have to do with expansion/collapse of items)
     if item and item is not self._expanded_item:
         self.emit(SIGNAL("mouseButtonClicked"), ev.button(), item, self._mouse_press_pos, col)
Exemple #2
0
 def mouseReleaseEvent(self, ev):
     item = self.itemAt(self._mouse_press_pos)
     if item:
         col = self.header().logicalIndexAt(self._mouse_press_pos)
     # pass event to parent
     QTreeWidget.mouseReleaseEvent(self, ev)
     # now see if the item was expanded or collapsed because of the event. Only emit signal if this was
     # not the case (i.e. swallow the clicks that have to do with expansion/collapse of items)
     if item and item is not self._expanded_item:
         self.emit(SIGNAL("mouseButtonClicked"), ev.button(), item,
                   self._mouse_press_pos, col)