本文整理汇总了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)
示例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)
示例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'
示例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)
示例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
#
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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
#
示例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)
示例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
#
示例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)