根据坐标获取方向 :param pos: QPoint :param width: int :param height: int :return: Qt.Edges
(self, pos, width, height)
| 46 | cls.Widgets.remove(widget) |
| 47 | |
| 48 | def _get_edges(self, pos, width, height): |
| 49 | """根据坐标获取方向 |
| 50 | :param pos: QPoint |
| 51 | :param width: int |
| 52 | :param height: int |
| 53 | :return: Qt.Edges |
| 54 | """ |
| 55 | edge = 0 |
| 56 | x, y = pos.x(), pos.y() |
| 57 | |
| 58 | if y <= self.Margins: |
| 59 | edge |= Qt.TopEdge |
| 60 | if x <= self.Margins: |
| 61 | edge |= Qt.LeftEdge |
| 62 | if x >= width - self.Margins: |
| 63 | edge |= Qt.RightEdge |
| 64 | if y >= height - self.Margins: |
| 65 | edge |= Qt.BottomEdge |
| 66 | |
| 67 | return edge |
| 68 | |
| 69 | def _get_cursor(self, edges): |
| 70 | """调整鼠标样式 |
no test coverage detected