what is the best way to determine location of task bar using Qt ?
What I need is the alignment (left,right,top,bottm) and bounderies (left,right,width,height)
Thanks 开发者_如何学Gofor help in advance :-)
You can infer the orientation of the task bar by comparing the dimensions of the screen against the dimensions of the desktop
def get_task_bar_position(self):
desktop = QtWidgets.QDesktopWidget()
displayRect = desktop.screenGeometry()
desktopRect = desktop.availableGeometry()
if desktopRect.height() < displayRect.height():
if desktopRect.y() > displayRect.y():
return 'TOP'
else:
return 'BOTTOM'
else:
if desktopRect.x() > displayRect.x():
return 'LEFT'
else:
return 'RIGHT'
I think Qt does not provide this facility. You will probably have to resort to the WinAPI to get this information.
See: http://msdn.microsoft.com/en-us/library/bb762108%28v=vs.85%29.aspx
精彩评论