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


Python Qt.LeftButton方法代码示例

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


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

示例1: mousePressEvent

# 需要导入模块: from PySide2.QtCore import Qt [as 别名]
# 或者: from PySide2.QtCore.Qt import LeftButton [as 别名]
def mousePressEvent(self, event: QGraphicsSceneMouseEvent):
        if event.button() == Qt.LeftButton and QApplication.keyboardModifiers() in (Qt.NoModifier, Qt.ControlModifier):
            # toggle selection
            self.infodock.toggle_instruction_selection(
                self.addr,
                insn_pos=self.scenePos(),
                unique=QApplication.keyboardModifiers() != Qt.ControlModifier)
            event.accept()
        elif event.button() == Qt.RightButton and QApplication.keyboardModifiers() == Qt.NoModifier:
            if self.addr not in self.infodock.selected_insns:
                self.infodock.toggle_instruction_selection(self.addr, insn_pos=self.scenePos(), unique=True)
            self.disasm_view.instruction_context_menu(self.insn, QCursor.pos())
            event.accept()
        elif self.workspace.plugins.handle_click_insn(self, event):
            event.accept()
        else:
            super().mousePressEvent(event) 
开发者ID:angr,项目名称:angr-management,代码行数:19,代码来源:qinstruction.py

示例2: mousePressEvent

# 需要导入模块: from PySide2.QtCore import Qt [as 别名]
# 或者: from PySide2.QtCore.Qt import LeftButton [as 别名]
def mousePressEvent(self, event):
        """ click event to select / deselect widgets """

        if event.button() == Qt.LeftButton:
            if self.is_selected:
                self.deselect()
            else:
                self.select()
            self.clicked.emit(self, event) 
开发者ID:wiremas,项目名称:spore,代码行数:11,代码来源:manager_ui.py

示例3: test_copy_button

# 需要导入模块: from PySide2.QtCore import Qt [as 别名]
# 或者: from PySide2.QtCore.Qt import LeftButton [as 别名]
def test_copy_button(self, copy_button: CopyButton, qtbot: QTest):
        qtbot.mouseClick(copy_button.button, Qt.LeftButton)
        assert QClipboard().text() == 'copy_this' 
开发者ID:lightning-power-users,项目名称:node-launcher,代码行数:5,代码来源:test_copy_button.py

示例4: test_close_button_closes_ui

# 需要导入模块: from PySide2.QtCore import Qt [as 别名]
# 或者: from PySide2.QtCore.Qt import LeftButton [as 别名]
def test_close_button_closes_ui(self):
        """testing if the close button is closing the ui
        """
        self.dialog.show()

        self.assertEqual(self.dialog.isVisible(), True)

        # now run the UI
        QTest.mouseClick(self.dialog.close_pushButton, Qt.LeftButton)
        self.assertEqual(self.dialog.isVisible(), False) 
开发者ID:eoyilmaz,项目名称:anima,代码行数:12,代码来源:test_version_creator.py

示例5: mousePressEvent

# 需要导入模块: from PySide2.QtCore import Qt [as 别名]
# 或者: from PySide2.QtCore.Qt import LeftButton [as 别名]
def mousePressEvent(self, event):
        if event.button() == Qt.LeftButton:
            self.infodock.select_label(self.addr)
        elif event.button() == Qt.RightButton and QApplication.keyboardModifiers() == Qt.NoModifier:
            if self.addr not in self.infodock.selected_labels:
                self.infodock.select_label(self.addr)
            self._disasm_view.label_context_menu(self.addr, QCursor.pos())

    #
    # Private methods
    # 
开发者ID:angr,项目名称:angr-management,代码行数:13,代码来源:qfunction_header.py

示例6: mousePressEvent

# 需要导入模块: from PySide2.QtCore import Qt [as 别名]
# 或者: from PySide2.QtCore.Qt import LeftButton [as 别名]
def mousePressEvent(self, event):
        # _l.debug('Received press')
        if event.button() == Qt.LeftButton:

            self._is_mouse_pressed = True
            self._is_dragging = False

            self._save_last_coords(event)
            event.accept()

        super().mousePressEvent(event) 
开发者ID:angr,项目名称:angr-management,代码行数:13,代码来源:qgraph.py

示例7: mouseReleaseEvent

# 需要导入模块: from PySide2.QtCore import Qt [as 别名]
# 或者: from PySide2.QtCore.Qt import LeftButton [as 别名]
def mouseReleaseEvent(self, event):
        """

        :param QMouseEvent event:
        :return:
        """

        if event.button() == Qt.LeftButton:
            if self._is_dragging:
                self.viewport().setCursor(Qt.ArrowCursor)
                event.accept()

        if not event.isAccepted():
            # create a new event and dispatch it to the scene
            pressy = QMouseEvent(QEvent.MouseButtonPress,
                                 event.pos(),
                                 event.globalPos(),
                                 event.button(),
                                 event.buttons(),
                                 event.modifiers())

            press_event = self.dispatchMouseEventToScene(pressy)

            releasy = QMouseEvent(QEvent.MouseButtonRelease,
                                  event.pos(),
                                  event.globalPos(),
                                  event.buton(),
                                  event.buttons(),
                                  event.modifiers())
            release_event = self.dispatchMouseEventToScene(releasy)

            if not release_event.isAccepted():
                self.on_background_click()
                release_event.accept()

        self._is_mouse_pressed = False
        self._is_dragging = False

        super().mouseReleaseEvent(event) 
开发者ID:angr,项目名称:angr-management,代码行数:41,代码来源:qgraph.py

示例8: mousePressEvent

# 需要导入模块: from PySide2.QtCore import Qt [as 别名]
# 或者: from PySide2.QtCore.Qt import LeftButton [as 别名]
def mousePressEvent(self, mouseEvent):
        """

        :param QGraphicsSceneMouseEvent mouseEvent:
        :return:
        """

        if mouseEvent.button() == Qt.LeftButton:
            pos = mouseEvent.scenePos()
            offset = pos.x()
            self._feature_map.select_offset(offset) 
开发者ID:angr,项目名称:angr-management,代码行数:13,代码来源:qfeature_map.py

示例9: mouseDoubleClickEvent

# 需要导入模块: from PySide2.QtCore import Qt [as 别名]
# 或者: from PySide2.QtCore.Qt import LeftButton [as 别名]
def mouseDoubleClickEvent(self, event):
        # _l.debug('QStateBlock received mouse double click event')
        if event.button() == Qt.LeftButton:
            if self.state is not None:
                self._workspace.viz(self.state.addr)
                event.accept()
            elif self.history is not None:
                self._workspace.viz(self.history.state.addr)
                event.accept()

        super().mouseDoubleClickEvent(event) 
开发者ID:angr,项目名称:angr-management,代码行数:13,代码来源:qstate_block.py

示例10: mouseReleaseEvent

# 需要导入模块: from PySide2.QtCore import Qt [as 别名]
# 或者: from PySide2.QtCore.Qt import LeftButton [as 别名]
def mouseReleaseEvent(self, event):
        # _l.debug('QStateBlock received mouse release event')
        if event.button() == Qt.LeftButton:
            self.selected = not self.selected
            self._dep_view.redraw_graph()
            event.accept()

        super().mouseReleaseEvent(event) 
开发者ID:angr,项目名称:angr-management,代码行数:10,代码来源:qdepgraph_block.py

示例11: mouseDoubleClickEvent

# 需要导入模块: from PySide2.QtCore import Qt [as 别名]
# 或者: from PySide2.QtCore.Qt import LeftButton [as 别名]
def mouseDoubleClickEvent(self, event):
        # _l.debug('QStateBlock received mouse double click event')
        if event.button() == Qt.LeftButton:
            self._workspace.viz(self.addr)
            event.accept()

        super().mouseDoubleClickEvent(event) 
开发者ID:angr,项目名称:angr-management,代码行数:9,代码来源:qdepgraph_block.py

示例12: mousePressEvent

# 需要导入模块: from PySide2.QtCore import Qt [as 别名]
# 或者: from PySide2.QtCore.Qt import LeftButton [as 别名]
def mousePressEvent(self, event):
        if event.button() == Qt.LeftButton:
            # unselect all other labels
            self.infodock.unselect_all_labels()
            # select this label
            self.infodock.select_label(self.addr)

    #
    # Private methods
    # 
开发者ID:angr,项目名称:angr-management,代码行数:12,代码来源:qmemory_data_block.py

示例13: mousePressEvent

# 需要导入模块: from PySide2.QtCore import Qt [as 别名]
# 或者: from PySide2.QtCore.Qt import LeftButton [as 别名]
def mousePressEvent(self, event):
        if event.button() == Qt.LeftButton:
            selected = self.infodock.toggle_operand_selection(
                self.insn.addr,
                self.operand_index,
                self.operand_descriptor,
                insn_pos=self.parentItem().scenePos(),
                unique=QApplication.keyboardModifiers() != Qt.ControlModifier
            )
            if selected:
                # select the current instruction, too
                self.infodock.select_instruction(self.insn.addr, insn_pos=QPointF(self.x(), self.y()), unique=True)
        else:
            super().mousePressEvent(event) 
开发者ID:angr,项目名称:angr-management,代码行数:16,代码来源:qoperand.py

示例14: mousePressEvent

# 需要导入模块: from PySide2.QtCore import Qt [as 别名]
# 或者: from PySide2.QtCore.Qt import LeftButton [as 别名]
def mousePressEvent(self, event):
        if event.button() == Qt.LeftButton:
            self.infodock.select_label(self.addr)

    #
    # Private methods
    # 
开发者ID:angr,项目名称:angr-management,代码行数:9,代码来源:qblock_label.py

示例15: mousePressEvent

# 需要导入模块: from PySide2.QtCore import Qt [as 别名]
# 或者: from PySide2.QtCore.Qt import LeftButton [as 别名]
def mousePressEvent(self, event):
        button = event.button()
        pos = self._to_logical_pos(event.pos())
        if button == Qt.LeftButton and self._at_legend(pos):
            func = self._get_func_from_y(pos.y())
            bbl_addr = self._get_bbl_from_y(pos.y())
            self._use_precise_position = True
            self.curr_position = self._get_position(pos.y())
            self._jump_bbl(func, bbl_addr) 
开发者ID:angr,项目名称:angr-management,代码行数:11,代码来源:qtrace_viewer.py


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