Example #1
0
 def _on_fortschritt_clicked(self, event: gui.QMouseEvent):
     self._aktualisiere_label()
     control_pressed = event.modifiers() & core.Qt.ControlModifier
     alt_pressed = event.modifiers() & core.Qt.AltModifier
     if control_pressed and alt_pressed:
         self.toggl_play_pause()
     elif control_pressed:
         self.play()
     elif alt_pressed:
         self.pause()
Example #2
0
    def doubleClickInstance(self,
                            instance: Instance,
                            event: QtGui.QMouseEvent = None):
        """
        Handles when the user has double-clicked an instance.

        If prediction, then copy to new user-instance.
        If already user instance, then add any missing nodes (in case
        skeleton has been changed after instance was created).

        Args:
            instance: The :class:`Instance` that was double-clicked.
        """
        # When a predicted instance is double-clicked, add a new instance
        if hasattr(instance, "score"):
            mark_complete = False
            # Mark the nodes as "complete" if shift-key is down
            if event is not None and event.modifiers() & Qt.ShiftModifier:
                mark_complete = True

            self.commands.newInstance(copy_instance=instance,
                                      mark_complete=mark_complete)

        # When a regular instance is double-clicked, add any missing points
        else:
            self.commands.completeInstanceNodes(instance)
 def __cloneMouseEvent(self, e: QMouseEvent):
     event_type = e.type()
     local_pos = e.localPos()
     button = e.button()
     buttons = e.buttons()
     modifiers = e.modifiers()
     clone = QMouseEvent(event_type, local_pos, button, buttons, modifiers)
     clone.ignore()
     return clone