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


Python Qt.SizeHorCursor方法代码示例

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


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

示例1: eventFilter

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import SizeHorCursor [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) 
开发者ID:dragondjf,项目名称:QMusic,代码行数:24,代码来源:lrcwindow.py

示例2: updateMouseStyle

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import SizeHorCursor [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) 
开发者ID:shuoGG1239,项目名称:QCandyUi,代码行数:28,代码来源:WindowWithTitleBar.py

示例3: adjustCursor

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import SizeHorCursor [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) 
开发者ID:PyQt5,项目名称:CustomWidgets,代码行数:17,代码来源:CFramelessWidget.py

示例4: mouseMoveEvent

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import SizeHorCursor [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) 
开发者ID:PyQt5,项目名称:PyQt,代码行数:47,代码来源:FramelessWindow.py


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