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


Python QRectF.setY方法代码示例

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


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

示例1: layoutLegend

# 需要导入模块: from qwt.qt.QtCore import QRectF [as 别名]
# 或者: from qwt.qt.QtCore.QRectF import setY [as 别名]
 def layoutLegend(self, options, rect):
     """
     Find the geometry for the legend
     
     :param options: Options how to layout the legend
     :param QRectF rect: Rectangle where to place the legend
     :return: Geometry for the legend
     """
     hint = self.__data.layoutData.legend.hint
     if self.__data.legendPos in (QwtPlot.LeftLegend, QwtPlot.RightLegend):
         dim = min([hint.width(), int(rect.width()*self.__data.legendRatio)])
         if not (options & self.IgnoreScrollbars):
             if hint.height() > rect.height():
                 dim += self.__data.layoutData.legend.hScrollExtent
     else:
         dim = min([hint.height(), int(rect.height()*self.__data.legendRatio)])
         dim = max([dim, self.__data.layoutData.legend.vScrollExtent])
     legendRect = QRectF(rect)
     if self.__data.legendPos == QwtPlot.LeftLegend:
         legendRect.setWidth(dim)
     elif self.__data.legendPos == QwtPlot.RightLegend:
         legendRect.setX(rect.right()-dim)
         legendRect.setWidth(dim)
     elif self.__data.legendPos == QwtPlot.TopLegend:
         legendRect.setHeight(dim)
     elif self.__data.legendPos == QwtPlot.BottomLegend:
         legendRect.setY(rect.bottom()-dim)
         legendRect.setHeight(dim)
     return legendRect
开发者ID:berrosse,项目名称:PythonQwt,代码行数:31,代码来源:plot_layout.py

示例2: layoutLegend

# 需要导入模块: from qwt.qt.QtCore import QRectF [as 别名]
# 或者: from qwt.qt.QtCore.QRectF import setY [as 别名]
 def layoutLegend(self, options, rect):
     hint = self.__data.layoutData.legend.hint
     if self.__data.legendPos in (QwtPlot.LeftLegend, QwtPlot.RightLegend):
         dim = min([hint.width(), int(rect.width()*self.__data.legendRatio)])
         if not (options & self.IgnoreScrollbars):
             if hint.height() > rect.height():
                 dim += self.__data.layoutData.legend.hScrollExtent
     else:
         dim = min([hint.height(), int(rect.height()*self.__data.legendRatio)])
         dim = max([dim, self.__data.layoutData.legend.vScrollExtent])
     legendRect = QRectF(rect)
     if self.__data.legendPos == QwtPlot.LeftLegend:
         legendRect.setWidth(dim)
     elif self.__data.legendPos == QwtPlot.RightLegend:
         legendRect.setX(rect.right()-dim)
         legendRect.setWidth(dim)
     elif self.__data.legendPos == QwtPlot.TopLegend:
         legendRect.setHeight(dim)
     elif self.__data.legendPos == QwtPlot.BottomLegend:
         legendRect.setY(rect.bottom()-dim)
         legendRect.setHeight(dim)
     return legendRect
开发者ID:petebachant,项目名称:python-qwt,代码行数:24,代码来源:plot_layout.py


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