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


Python QRect.height方法代码示例

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


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

示例1: screen_pos_size

# 需要导入模块: from PyQt4.Qt import QRect [as 别名]
# 或者: from PyQt4.Qt.QRect import height [as 别名]
def screen_pos_size(): ###e this copies code in main.py -- main.py should call this
    """
    Return (x,y),(w,h), where the main screen area
    (not including menubar, for Mac) is in a rect of size w,h,
    topleft at x,y. Note that x,y is 0,0 except for Mac.
    Current implementation guesses Mac menubar size since it doesn't
    know how to measure it.
    """
    # Create desktop widget to obtain screen resolution
    dtop = QDesktopWidget()
    screensize = QRect (dtop.screenGeometry (0))

    if is_macintosh():
        # menubar_height = 44 was measured (approximately) on an iMac G5 20 inch
        # screen; I don't know if it's the same on all Macs (or whether it can
        # vary with OS or user settings). (Is there any way of getting this info
        # from Qt? #e)
        menubar_height = 44
    else:
        menubar_height = 0

    screen_w = screensize.width()
    screen_h = screensize.height() # of which menubar_height is in use at the top

    x,y = 0,0
    w,h = screen_w, screen_h

    y += menubar_height
    h -= menubar_height

    return (x,y), (w,h)
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:33,代码来源:PlatformDependent.py


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