Ejemplo n.º 1
0
 def eventFilter(self, watched, e):
     '''
     Capture mouse release event when the user clicks to close the message
     '''
     if QEvent is None:
         return False
     if watched == self.lblClose and e.type() == QEvent.MouseButtonRelease:
         self.messageClosed.emit(self.code)
         self.deleteLater()
         return True
     else:
         return QWidget.eventFilter(self, watched, e)
Ejemplo n.º 2
0
    def eventFilter(self, watched, e):
        """
        Capture label mouse release events
        for deleting and opening a source
        document respectively.
        """
        if QEvent is None:
            return False

        if watched == self.lblClose and e.type() == QEvent.MouseButtonRelease:
            self.removeDocument()
            return True

        elif watched == self.lblName and e.type() == QEvent.MouseButtonRelease:
            self.openDocument()
            return True

        else:
            return QWidget.eventFilter(self, watched, e)