window_list.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:gpvdm 作者: roderickmackenzie 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号