本文整理汇总了Python中PyQt5.QtCore.Qt.ClosedHandCursor方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.ClosedHandCursor方法的具体用法?Python Qt.ClosedHandCursor怎么用?Python Qt.ClosedHandCursor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.ClosedHandCursor方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mousePressEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import ClosedHandCursor [as 别名]
def mousePressEvent(self, event):
if self.isPanning or self.isRotating:
self.setCursor(Qt.ClosedHandCursor)
elif event.button() == Qt.LeftButton:
clicked, offset, tol = self.getClickedDetails(event)
xyForZ = {}
for shape in self.shapes:
hit = False
z = shape.axis3_start_mill_depth
if z not in xyForZ:
xyForZ[z] = self.determineSelectedPosition(clicked, z, offset)
hit |= shape.isHit(xyForZ[z], tol)
if not hit:
z = shape.axis3_mill_depth
if z not in xyForZ:
xyForZ[z] = self.determineSelectedPosition(clicked, z, offset)
hit |= shape.isHit(xyForZ[z], tol)
if self.isMultiSelect and shape.selected:
hit = not hit
if hit != shape.selected:
g.window.TreeHandler.updateShapeSelection(shape, hit)
shape.selected = hit
self.update()
self._lastPos = event.pos()
示例2: mousePressEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import ClosedHandCursor [as 别名]
def mousePressEvent(self, event):
self.mouseMoveLastPosition = event.scenePos();
if event.button() == Qt.LeftButton:
self.setCursor(Qt.ClosedHandCursor)
else:
self.switchToNextEffect()
示例3: mouseReleaseEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import ClosedHandCursor [as 别名]
def mouseReleaseEvent(self, event: QMouseEvent):
if self.scene() is None:
return
cursor = self.cursor().shape()
if cursor == Qt.ClosedHandCursor:
self.grab_start = None
self.setCursor(Qt.OpenHandCursor)
elif self.separation_area_moving:
y_sep = self.mapToScene(event.pos()).y()
y = self.sceneRect().y()
h = self.sceneRect().height()
if y_sep < y:
y_sep = y
elif y_sep > y + h:
y_sep = y + h
self.scene().draw_sep_area(y_sep)
self.sep_area_moving.emit(y_sep)
self.separation_area_moving = False
self.y_sep = y_sep
self.sep_area_changed.emit(-y_sep)
self.unsetCursor()
self.selection_area.finished = True
self.selection_area.resizing = False
self.emit_selection_size_changed()
self.emit_selection_start_end_changed()
示例4: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import ClosedHandCursor [as 别名]
def __init__(self, parent):
super(HomographyView, self).__init__(parent)
self.cursor_default = QtGui.QCursor(Qt.CrossCursor)
self.cursor_hover = QtGui.QCursor(Qt.OpenHandCursor)
self.cursor_drag = QtGui.QCursor(Qt.ClosedHandCursor)
self.image_loaded = False
self.status_label = None
示例5: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import ClosedHandCursor [as 别名]
def __init__(self):
self.m_cursorNames = QList()
self.m_cursorIcons = QMap()
self.m_valueToCursorShape = QMap()
self.m_cursorShapeToValue = QMap()
self.appendCursor(Qt.ArrowCursor, QCoreApplication.translate("QtCursorDatabase", "Arrow"),
QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-arrow.png"))
self.appendCursor(Qt.UpArrowCursor, QCoreApplication.translate("QtCursorDatabase", "Up Arrow"),
QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-uparrow.png"))
self.appendCursor(Qt.CrossCursor, QCoreApplication.translate("QtCursorDatabase", "Cross"),
QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-cross.png"))
self.appendCursor(Qt.WaitCursor, QCoreApplication.translate("QtCursorDatabase", "Wait"),
QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-wait.png"))
self.appendCursor(Qt.IBeamCursor, QCoreApplication.translate("QtCursorDatabase", "IBeam"),
QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-ibeam.png"))
self.appendCursor(Qt.SizeVerCursor, QCoreApplication.translate("QtCursorDatabase", "Size Vertical"),
QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-sizev.png"))
self.appendCursor(Qt.SizeHorCursor, QCoreApplication.translate("QtCursorDatabase", "Size Horizontal"),
QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-sizeh.png"))
self.appendCursor(Qt.SizeFDiagCursor, QCoreApplication.translate("QtCursorDatabase", "Size Backslash"),
QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-sizef.png"))
self.appendCursor(Qt.SizeBDiagCursor, QCoreApplication.translate("QtCursorDatabase", "Size Slash"),
QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-sizeb.png"))
self.appendCursor(Qt.SizeAllCursor, QCoreApplication.translate("QtCursorDatabase", "Size All"),
QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-sizeall.png"))
self.appendCursor(Qt.BlankCursor, QCoreApplication.translate("QtCursorDatabase", "Blank"),
QIcon())
self.appendCursor(Qt.SplitVCursor, QCoreApplication.translate("QtCursorDatabase", "Split Vertical"),
QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-vsplit.png"))
self.appendCursor(Qt.SplitHCursor, QCoreApplication.translate("QtCursorDatabase", "Split Horizontal"),
QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-hsplit.png"))
self.appendCursor(Qt.PointingHandCursor, QCoreApplication.translate("QtCursorDatabase", "Pointing Hand"),
QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-hand.png"))
self.appendCursor(Qt.ForbiddenCursor, QCoreApplication.translate("QtCursorDatabase", "Forbidden"),
QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-forbidden.png"))
self.appendCursor(Qt.OpenHandCursor, QCoreApplication.translate("QtCursorDatabase", "Open Hand"),
QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-openhand.png"))
self.appendCursor(Qt.ClosedHandCursor, QCoreApplication.translate("QtCursorDatabase", "Closed Hand"),
QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-closedhand.png"))
self.appendCursor(Qt.WhatsThisCursor, QCoreApplication.translate("QtCursorDatabase", "What's This"),
QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-whatsthis.png"))
self.appendCursor(Qt.BusyCursor, QCoreApplication.translate("QtCursorDatabase", "Busy"),
QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-busy.png"))
示例6: mousePressEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import ClosedHandCursor [as 别名]
def mousePressEvent(self, event: QMouseEvent):
if self.scene() is None:
return
cursor = self.cursor().shape()
has_shift_modifier = event.modifiers() == Qt.ShiftModifier
is_in_shift_mode = (has_shift_modifier and self.hold_shift_to_drag) \
or (not has_shift_modifier and not self.hold_shift_to_drag) \
and cursor != Qt.SplitHCursor and cursor != Qt.SplitVCursor
if event.buttons() == Qt.LeftButton and is_in_shift_mode:
self.setCursor(Qt.ClosedHandCursor)
self.grab_start = event.pos()
elif event.buttons() == Qt.LeftButton:
if self.is_pos_in_separea(self.mapToScene(event.pos())):
self.separation_area_moving = True
self.setCursor(Qt.SplitVCursor)
elif self.selection_area.is_empty or self.selection_area.selected_edge is None:
# Create new selection
self.mouse_press_pos = event.pos()
self.mouse_pos = event.pos()
scene_pos = self.mapToScene(self.mouse_press_pos)
self.__set_selection_area(x=scene_pos.x(), y=scene_pos.y(), w=0, h=0)
self.selection_area.finished = False
elif self.selection_area.selected_edge is not None:
self.selection_area.resizing = True