本文整理汇总了Python中PyQt5.QtCore.Qt.SizeVerCursor方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.SizeVerCursor方法的具体用法?Python Qt.SizeVerCursor怎么用?Python Qt.SizeVerCursor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.SizeVerCursor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: eventFilter
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import SizeVerCursor [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)
示例2: updateMouseStyle
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import SizeVerCursor [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)
示例3: adjustCursor
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import SizeVerCursor [as 别名]
def adjustCursor(self, edge):
"""根据边方向调整光标样式
:param edge:
"""
cursor = None
if edge in (TOP, BOTTOM):
cursor = Qt.SizeVerCursor
elif edge in (LEFT, RIGHT):
cursor = Qt.SizeHorCursor
elif edge in (LEFT | TOP, RIGHT | BOTTOM):
cursor = Qt.SizeFDiagCursor
elif edge in (TOP | RIGHT, BOTTOM | LEFT):
cursor = Qt.SizeBDiagCursor
if cursor and cursor != self.cursor():
self.setCursor(cursor)
示例4: mouseMoveEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import SizeVerCursor [as 别名]
def mouseMoveEvent(self, event):
"""鼠标移动事件"""
super(FramelessWindow, self).mouseMoveEvent(event)
pos = event.pos()
xPos, yPos = pos.x(), pos.y()
wm, hm = self.width() - self.Margins, self.height() - self.Margins
if self.isMaximized() or self.isFullScreen():
self.Direction = None
self.setCursor(Qt.ArrowCursor)
return
if event.buttons() == Qt.LeftButton and self._pressed:
self._resizeWidget(pos)
return
if xPos <= self.Margins and yPos <= self.Margins:
# 左上角
self.Direction = LeftTop
self.setCursor(Qt.SizeFDiagCursor)
elif wm <= xPos <= self.width() and hm <= yPos <= self.height():
# 右下角
self.Direction = RightBottom
self.setCursor(Qt.SizeFDiagCursor)
elif wm <= xPos and yPos <= self.Margins:
# 右上角
self.Direction = RightTop
self.setCursor(Qt.SizeBDiagCursor)
elif xPos <= self.Margins and hm <= yPos:
# 左下角
self.Direction = LeftBottom
self.setCursor(Qt.SizeBDiagCursor)
elif 0 <= xPos <= self.Margins and self.Margins <= yPos <= hm:
# 左边
self.Direction = Left
self.setCursor(Qt.SizeHorCursor)
elif wm <= xPos <= self.width() and self.Margins <= yPos <= hm:
# 右边
self.Direction = Right
self.setCursor(Qt.SizeHorCursor)
elif self.Margins <= xPos <= wm and 0 <= yPos <= self.Margins:
# 上面
self.Direction = Top
self.setCursor(Qt.SizeVerCursor)
elif self.Margins <= xPos <= wm and hm <= yPos <= self.height():
# 下面
self.Direction = Bottom
self.setCursor(Qt.SizeVerCursor)