當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。