def wpos_set_window(window,name):
#print("set")
global wlist
for i in range(0,len(wlist)):
if wlist[i].name==name:
shape=QDesktopWidget().screenGeometry()
desktop_w=shape.width()
desktop_h=shape.height()
w=window.width()
h=window.height()
x=int(wlist[i].x)
y=int(wlist[i].y)
if (x+w>desktop_w) or x<0:
x=desktop_w/2-w/2
#print("Reset with",x)
if (y+h>desktop_h) or y<0:
y=desktop_h/2-h/2
#print("Reset height",y)
window.move(x,y)
break
评论列表
文章目录