本文整理汇总了Python中PyQt4.Qt.QRect.width方法的典型用法代码示例。如果您正苦于以下问题:Python QRect.width方法的具体用法?Python QRect.width怎么用?Python QRect.width使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.Qt.QRect
的用法示例。
在下文中一共展示了QRect.width方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: screen_pos_size
# 需要导入模块: from PyQt4.Qt import QRect [as 别名]
# 或者: from PyQt4.Qt.QRect import width [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)