本文整理汇总了Python中PyQt5.QtCore.Qt.ArrowCursor方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.ArrowCursor方法的具体用法?Python Qt.ArrowCursor怎么用?Python Qt.ArrowCursor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.ArrowCursor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mouseReleaseEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import ArrowCursor [as 别名]
def mouseReleaseEvent(self, event):
if event.button() == Qt.RightButton:
self.rubberBand.hide()
rb_rect = QRect(self._rb_origin, event.pos())
rb_center = rb_rect.center()
rb_size = rb_rect.size()
if abs(rb_size.width()) > 3 and abs(rb_size.height()) > 3:
viewport_size = self.viewport().geometry().size()
zoom_factor_x = abs(viewport_size.width() / rb_size.width())
zoom_factor_y = abs(viewport_size.height() / rb_size.height())
new_center = self.mapToScene(rb_center)
zoom_factor = min(zoom_factor_x, zoom_factor_y)
self.zoom_view(zoom_factor)
self.centerOn(new_center)
self.update_grid()
if event.button() == Qt.MidButton:
self.setCursor(Qt.ArrowCursor)
self._mousePressed = None
self.update_grid()
示例2: eventFilter
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import ArrowCursor [as 别名]
def eventFilter(self, obj, event):
if event.type() == QEvent.HoverMove:
if self.width() - event.pos().x() < 5:
self.setCursor(Qt.SizeHorCursor)
self.isCusorRightSide = True
elif self.height() - event.pos().y() < 5:
self.setCursor(Qt.SizeVerCursor)
self.isCusorDownSide = True
elif event.pos().x() < 5:
self.setCursor(Qt.SizeHorCursor)
self.isCusorLeftSide = True
elif not self.isSideClicked:
self.setCursor(Qt.ArrowCursor)
self.isCusorLeftSide = False
self.isCusorRightSide = False
self.isCusorDownSide = False
elif event.type() == QEvent.HoverEnter:
self.boderFlag = True
elif event.type() == QEvent.HoverLeave:
self.boderFlag = False
return super(FMoveableWidget, self).eventFilter(obj, event)
示例3: _set_size_attributes
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import ArrowCursor [as 别名]
def _set_size_attributes(self):
"""Sets the size policies of frame"""
size_policy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed)
size_policy.setHorizontalStretch(0)
size_policy.setVerticalStretch(0)
size_policy.setHeightForWidth(self.sizePolicy().hasHeightForWidth())
self.setSizePolicy(size_policy)
self.setCursor(QCursor(Qt.ArrowCursor))
self.setFrameShape(QFrame.StyledPanel)
self.setFrameShadow(QFrame.Raised)
self.setLineWidth(1)
示例4: mouseReleaseEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import ArrowCursor [as 别名]
def mouseReleaseEvent(self, event):
# 鼠标释放事件
if hasattr(self, "dragPosition"):
del self.dragPosition
self.isSideClicked = False
self.setCursor(Qt.ArrowCursor)
示例5: updateMouseStyle
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import ArrowCursor [as 别名]
def updateMouseStyle(self, stretchState):
"""
根据stretchState刷新鼠标的样式
:param stretchState:
:return:
"""
if stretchState == NO_SELECT:
self.setCursor(Qt.ArrowCursor)
elif stretchState == LEFT_TOP_RECT:
self.setCursor(Qt.SizeFDiagCursor)
elif stretchState == RIGHT_BOTTOM_RECT:
self.setCursor(Qt.SizeFDiagCursor)
elif stretchState == TOP_BORDER:
self.setCursor(Qt.SizeVerCursor)
elif stretchState == BOTTOM_BORDER:
self.setCursor(Qt.SizeVerCursor)
elif stretchState == RIGHT_TOP_RECT:
self.setCursor(Qt.SizeBDiagCursor)
elif stretchState == LEFT_BOTTOM_RECT:
self.setCursor(Qt.SizeBDiagCursor)
elif stretchState == LEFT_BORDER:
self.setCursor(Qt.SizeHorCursor)
elif stretchState == RIGHT_BORDER:
self.setCursor(Qt.SizeHorCursor)
else:
self.setCursor(Qt.ArrowCursor)
示例6: mouseMoveEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import ArrowCursor [as 别名]
def mouseMoveEvent(self, event: QMouseEvent) -> None:
if self.count() > 0:
if self.indexAt(event.pos()).isValid():
self.setCursor(Qt.PointingHandCursor)
else:
self.setCursor(Qt.ArrowCursor)
super(VideoList, self).mouseMoveEvent(event)
示例7: setArrowCursor
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import ArrowCursor [as 别名]
def setArrowCursor(self):
self.setCursor(Qt.ArrowCursor)
示例8: mouseReleaseEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import ArrowCursor [as 别名]
def mouseReleaseEvent(self, event):
super(CColorStraw, self).mouseReleaseEvent(event)
# 设置鼠标样式为普通
self.setCursor(Qt.ArrowCursor)
self._scaleWindow.hide()
示例9: eventFilter
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import ArrowCursor [as 别名]
def eventFilter(self, obj, event):
"""事件过滤器,用于解决鼠标进入其它控件后还原为标准鼠标样式
"""
if isinstance(event, QEnterEvent):
self.setCursor(self.originalCusor or Qt.ArrowCursor)
return self.BaseClass.eventFilter(self, obj, event)
示例10: ShowCursor
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import ArrowCursor [as 别名]
def ShowCursor(self):
"""Shows the cursor."""
vtk_cursor = self._Iren.GetRenderWindow().GetCurrentCursor()
qt_cursor = self._CURSOR_MAP.get(vtk_cursor, Qt.ArrowCursor)
self.setCursor(qt_cursor)
示例11: returnCursorToNormal
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import ArrowCursor [as 别名]
def returnCursorToNormal(self) -> None:
cursor: QCursor = QCursor(Qt.ArrowCursor)
QApplication.setOverrideCursor(cursor)
QApplication.changeOverrideCursor(cursor)
示例12: normal_cursor
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import ArrowCursor [as 别名]
def normal_cursor(self):
# Returns the cursor to normal cursor
cursor = QCursor(Qt.ArrowCursor)
QApplication.setOverrideCursor(cursor)
QApplication.changeOverrideCursor(cursor)
示例13: mouseMoveEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import ArrowCursor [as 别名]
def mouseMoveEvent(self, event):
cursor = QCursor(Qt.ArrowCursor)
QApplication.setOverrideCursor(cursor)
QApplication.changeOverrideCursor(cursor)
super().mouseMoveEvent(event)
示例14: enterEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import ArrowCursor [as 别名]
def enterEvent(self, event):
self.setCursor(Qt.ArrowCursor)
super(TitleBar, self).enterEvent(event)
示例15: eventFilter
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import ArrowCursor [as 别名]
def eventFilter(self, obj, event):
"""事件过滤器,用于解决鼠标进入其它控件后还原为标准鼠标样式"""
if isinstance(event, QEnterEvent):
self.setCursor(Qt.ArrowCursor)
return super(FramelessWindow, self).eventFilter(obj, event)