# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]

# 或者: from PyQt5.QtCore.Qt import SizeFDiagCursor [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)

python qt刷新_Python Qt.SizeFDiagCursor方法代码示例相关推荐

  1. python qt 按钮_Python QtWidgets.QPushButton方法代码示例

    本文整理汇总了Python中PySide2.QtWidgets.QPushButton方法的典型用法代码示例.如果您正苦于以下问题:Python QtWidgets.QPushButton方法的具体用 ...

  2. python html模板_Python html.format_html方法代码示例

    本文整理汇总了Python中django.utils.html.format_html方法的典型用法代码示例.如果您正苦于以下问题:Python html.format_html方法的具体用法?Pyt ...

  3. python session模块_Python backend.set_session方法代码示例

    本文整理汇总了Python中keras.backend.set_session方法的典型用法代码示例.如果您正苦于以下问题:Python backend.set_session方法的具体用法?Pyth ...

  4. python color属性_Python turtle.color方法代码示例

    本文整理汇总了Python中turtle.color方法的典型用法代码示例.如果您正苦于以下问题:Python turtle.color方法的具体用法?Python turtle.color怎么用?P ...

  5. python end用法_Python turtle.end_fill方法代码示例

    本文整理汇总了Python中turtle.end_fill方法的典型用法代码示例.如果您正苦于以下问题:Python turtle.end_fill方法的具体用法?Python turtle.end_ ...

  6. python geometry用法_Python geometry.MultiPolygon方法代码示例

    本文整理汇总了Python中shapely.geometry.MultiPolygon方法的典型用法代码示例.如果您正苦于以下问题:Python geometry.MultiPolygon方法的具体用 ...

  7. python logistic步骤_Python api.Logit方法代码示例

    本文整理汇总了Python中statsmodels.api.Logit方法的典型用法代码示例.如果您正苦于以下问题:Python api.Logit方法的具体用法?Python api.Logit怎么 ...

  8. python iteritems函数_Python six.iteritems方法代码示例

    本文整理汇总了Python中sklearn.externals.six.iteritems方法的典型用法代码示例.如果您正苦于以下问题:Python six.iteritems方法的具体用法?Pyth ...

  9. python gc模块_Python gc.collect方法代码示例

    本文整理汇总了Python中gc.collect方法的典型用法代码示例.如果您正苦于以下问题:Python gc.collect方法的具体用法?Python gc.collect怎么用?Python ...

  10. python fmod函数_Python numpy.fmod方法代码示例

    本文整理汇总了Python中numpy.fmod方法的典型用法代码示例.如果您正苦于以下问题:Python numpy.fmod方法的具体用法?Python numpy.fmod怎么用?Python ...

最新文章

  1. 【周末阅读】2019自动驾驶十大关键词
  2. [PHP] 访问MySQL
  3. Python 报错 SyntaxError: invalid syntax 解决方法
  4. JavaScript权威指南科03章 种类、值和变量(1)
  5. 二十四、数据挖掘时序模式
  6. WebServices 基础知识
  7. Capistrano deploy flow outline
  8. 本田2022年新车将搭载谷歌Automotive OS
  9. 【tarjan缩点】受欢迎的牛
  10. 谷歌云端语音识别服务软件
  11. 读取JSON文件并 排序,分组,
  12. 51CTO六周年,我不得不说的话!【我与51CTO的故事】
  13. 【读书笔记《Android游戏编程之从零开始》】6.Android 游戏开发常用的系统控件(TabHost、ListView)
  14. stm32呼吸灯c语言程序,STM32 呼吸灯程序请教
  15. elementUI + echar 实现饼图效果
  16. openstack虚拟机模板的搭建
  17. weka的java环境配置_weka环境配置
  18. 解决DLL load failed while importing _imaging: 找不到指定的模块。问题
  19. 高仿美团iOS版,版本号5.7
  20. 追问上交所资金校验缺失系统老化

热门文章

  1. 想成为一个怎样的人?
  2. python 代码片段24
  3. Myeclipse6.5中安装maven
  4. 周志华《机器学习》西瓜书第一章绪论第一部分
  5. 【ubuntu操作系统入门】Ubuntu常用命令大全一
  6. 普通卷积、转置卷积、空洞卷积(dilated convolution、Atrous Convolution)
  7. 按照某列属性拆分Excel文件
  8. 基于C语言实现NDVI处理
  9. 一、坐标系之WGS84坐标系与WGS84 Web Mercator
  10. mysql排序同值排名一致