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


Python Qt.ArrowCursor方法代码示例

本文整理汇总了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() 
开发者ID:amccaugh,项目名称:phidl,代码行数:27,代码来源:quickplotter.py

示例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) 
开发者ID:dragondjf,项目名称:QMusic,代码行数:24,代码来源:lrcwindow.py

示例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) 
开发者ID:MTG,项目名称:dunya-desktop,代码行数:13,代码来源:audioattframe.py

示例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) 
开发者ID:dragondjf,项目名称:QMusic,代码行数:8,代码来源:lrcwindow.py

示例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) 
开发者ID:shuoGG1239,项目名称:QCandyUi,代码行数:28,代码来源:WindowWithTitleBar.py

示例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) 
开发者ID:ozmartian,项目名称:vidcutter,代码行数:9,代码来源:videolist.py

示例7: setArrowCursor

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import ArrowCursor [as 别名]
def setArrowCursor(self):
        self.setCursor(Qt.ArrowCursor) 
开发者ID:ghostop14,项目名称:sparrow-wifi,代码行数:4,代码来源:sparrow-wifi.py

示例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() 
开发者ID:PyQt5,项目名称:CustomWidgets,代码行数:7,代码来源:CColorStraw.py

示例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) 
开发者ID:PyQt5,项目名称:CustomWidgets,代码行数:8,代码来源:CFramelessWidget.py

示例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) 
开发者ID:pyCGNS,项目名称:pyCGNS,代码行数:7,代码来源:Q7VTKRenderWindowInteractor.py

示例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) 
开发者ID:CountryTk,项目名称:Hydra,代码行数:7,代码来源:foldArea.py

示例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) 
开发者ID:CountryTk,项目名称:Hydra,代码行数:8,代码来源:Messagebox.py

示例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) 
开发者ID:CountryTk,项目名称:Hydra,代码行数:7,代码来源:Messagebox.py

示例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) 
开发者ID:PyQt5,项目名称:PyQt,代码行数:5,代码来源:FramelessWindow.py

示例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) 
开发者ID:PyQt5,项目名称:PyQt,代码行数:7,代码来源:FramelessWindow.py


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