Exemple #1
0
 def eventFilter(self, obj: QObject, event: QEvent) -> bool:
     if event.type() == QEvent.MouseButtonRelease:
         if self.parentWidget().mediaAvailable:
             self.setValue(
                 QStyle.sliderValueFromPosition(self.minimum(),
                                                self.maximum(), event.x(),
                                                self.width()))
             self.parentWidget().setPosition(self.sliderPosition())
     return super(VideoSlider, self).eventFilter(obj, event)
Exemple #2
0
 def eventFilter(self, obj: QObject, event: QEvent):
     if event.type() == QEvent.MouseButtonRelease:
         if self.parentWidget().mediaPlayer.isVideoAvailable(
         ) or self.parentWidget().mediaPlayer.isAudioAvailable():
             self.setValue(
                 QStyle.sliderValueFromPosition(self.minimum(),
                                                self.maximum(), event.x(),
                                                self.width()))
             self.parentWidget().mediaPlayer.setPosition(
                 self.sliderPosition())
     return QWidget.eventFilter(self, obj, event)
Exemple #3
0
 def eventFilter(self, obj: QObject, event: QEvent) -> bool:
     if event.type() == QEvent.MouseButtonRelease and isinstance(
             obj, VideoSlider):
         if obj.objectName() == 'VideoSlider' and (
                 self.mediaPlayer.isVideoAvailable()
                 or self.mediaPlayer.isAudioAvailable()):
             obj.setValue(
                 QStyle.sliderValueFromPosition(obj.minimum(),
                                                obj.maximum(), event.x(),
                                                obj.width()))
             self.mediaPlayer.setPosition(obj.sliderPosition())
     return QWidget.eventFilter(self, obj, event)
Exemple #4
0
 def mousePressEvent(self, event: QEvent) -> None:
     self.draw_rect(event.x(), event.y())