当前位置: 首页>>代码示例>>Python>>正文


Python QEvent.MouseButtonDblClick方法代码示例

本文整理汇总了Python中PyQt5.QtCore.QEvent.MouseButtonDblClick方法的典型用法代码示例。如果您正苦于以下问题:Python QEvent.MouseButtonDblClick方法的具体用法?Python QEvent.MouseButtonDblClick怎么用?Python QEvent.MouseButtonDblClick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt5.QtCore.QEvent的用法示例。


在下文中一共展示了QEvent.MouseButtonDblClick方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: editorEvent

# 需要导入模块: from PyQt5.QtCore import QEvent [as 别名]
# 或者: from PyQt5.QtCore.QEvent import MouseButtonDblClick [as 别名]
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 
开发者ID:aseylys,项目名称:KStock,代码行数:18,代码来源:CheckBoxDelegateQt.py

示例2: mousePressEvent

# 需要导入模块: from PyQt5.QtCore import QEvent [as 别名]
# 或者: from PyQt5.QtCore.QEvent import MouseButtonDblClick [as 别名]
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() 
开发者ID:pyCGNS,项目名称:pyCGNS,代码行数:18,代码来源:QVTKRenderWindowInteractor.py

示例3: mousePressEvent

# 需要导入模块: from PyQt5.QtCore import QEvent [as 别名]
# 或者: from PyQt5.QtCore.QEvent import MouseButtonDblClick [as 别名]
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() 
开发者ID:poodarchu,项目名称:Det3D,代码行数:19,代码来源:QVTKRenderWindowInteractor.py

示例4: editorEvent

# 需要导入模块: from PyQt5.QtCore import QEvent [as 别名]
# 或者: from PyQt5.QtCore.QEvent import MouseButtonDblClick [as 别名]
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) 
开发者ID:FrancescoCeruti,项目名称:linux-show-player,代码行数:12,代码来源:qdelegates.py

示例5: mousePressEvent

# 需要导入模块: from PyQt5.QtCore import QEvent [as 别名]
# 或者: from PyQt5.QtCore.QEvent import MouseButtonDblClick [as 别名]
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() 
开发者ID:pyCGNS,项目名称:pyCGNS,代码行数:30,代码来源:Q7VTKRenderWindowInteractor.py


注:本文中的PyQt5.QtCore.QEvent.MouseButtonDblClick方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。