Python PyQt5.QtCore.QEvent.MouseButtonDblClick() Examples

The following are 5 code examples of PyQt5.QtCore.QEvent.MouseButtonDblClick(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PyQt5.QtCore.QEvent , or try the search function .
Example #1
Source File: CheckBoxDelegateQt.py    From KStock with GNU General Public License v3.0 6 votes vote down vote up
def editorEvent(self, event, model, option, index):
        ''' 
        Change the data in the model and the state of the checkbox if the
        user presses the left mouse button and this cell is editable. Otherwise do nothing.
        '''
        if not (index.flags() & Qt.ItemIsEditable):
            return False
        if event.button() == Qt.LeftButton:
            if event.type() == QEvent.MouseButtonRelease:
                if self.getCheckBoxRect(option).contains(event.pos()):
                    self.setModelData(None, model, index)
                    return True
            elif event.type() == QEvent.MouseButtonDblClick:
                if self.getCheckBoxRect(option).contains(event.pos()):
                    return True
        return False 
Example #2
Source File: QVTKRenderWindowInteractor.py    From pyCGNS with GNU Lesser General Public License v2.1 6 votes vote down vote up
def mousePressEvent(self, ev):
        ctrl, shift = self._GetCtrlShift(ev)
        repeat = 0
        if ev.type() == QEvent.MouseButtonDblClick:
            repeat = 1
        self._Iren.SetEventInformationFlipY(ev.x(), ev.y(),
                                            ctrl, shift, chr(0), repeat, None)

        self._ActiveButton = ev.button()

        if self._ActiveButton == Qt.LeftButton:
            self._Iren.LeftButtonPressEvent()
        elif self._ActiveButton == Qt.RightButton:
            self._Iren.RightButtonPressEvent()
        elif self._ActiveButton == Qt.MidButton:
            self._Iren.MiddleButtonPressEvent() 
Example #3
Source File: QVTKRenderWindowInteractor.py    From Det3D with Apache License 2.0 6 votes vote down vote up
def mousePressEvent(self, ev):
        ctrl, shift = self._GetCtrlShift(ev)
        repeat = 0
        if ev.type() == QEvent.MouseButtonDblClick:
            repeat = 1
        self._Iren.SetEventInformationFlipY(
            ev.x(), ev.y(), ctrl, shift, chr(0), repeat, None
        )

        self._ActiveButton = ev.button()

        if self._ActiveButton == Qt.LeftButton:
            self._Iren.LeftButtonPressEvent()
        elif self._ActiveButton == Qt.RightButton:
            self._Iren.RightButtonPressEvent()
        elif self._ActiveButton == Qt.MidButton:
            self._Iren.MiddleButtonPressEvent() 
Example #4
Source File: qdelegates.py    From linux-show-player with GNU General Public License v3.0 5 votes vote down vote up
def editorEvent(self, event, model, option, index):
        if event.type() == QEvent.MouseButtonDblClick:
            if self.cue_select.exec_() == QDialog.Accepted:
                cue = self.cue_select.selected_cue()
                if cue is not None:
                    model.setData(index, cue.id, Qt.EditRole)
                    model.setData(index, cue.__class__, CueClassRole)
            return True

        return super().editorEvent(event, model, option, index) 
Example #5
Source File: Q7VTKRenderWindowInteractor.py    From pyCGNS with GNU Lesser General Public License v2.1 5 votes vote down vote up
def mousePressEvent(self, ev):
        ctrl, shift = self._GetCtrlShift(ev)
        repeat = 0
        if ev.type() == QEvent.MouseButtonDblClick:
            repeat = 1
        self._Iren.SetEventInformationFlipY(ev.x(), ev.y(),
                                            ctrl, shift, chr(0), repeat, None)

        self._ActiveButton = ev.button()

        if self._ActiveButton == Qt.LeftButton:
            self._Iren.LeftButtonPressEvent()
        elif self._ActiveButton == Qt.RightButton:
            self._Iren.RightButtonPressEvent()
        elif self._ActiveButton == Qt.MidButton:
            self._Iren.MiddleButtonPressEvent()

    #def mouseReleaseEvent(self, ev):
    #    ctrl, shift = self._GetCtrlShift(ev)
    #    self._Iren.SetEventInformationFlipY(ev.x(), ev.y(),
    #                                       ctrl, shift, chr(0), 0, None)

    #    if self._ActiveButton == Qt.LeftButton:
    #        self._Iren.LeftButtonReleaseEvent()
    #    elif self._ActiveButton == Qt.RightButton:
    #        self._Iren.RightButtonReleaseEvent()
    #    elif self._ActiveButton == Qt.MidButton:
    #        self._Iren.MiddleButtonReleaseEvent()