utils.py 文件源码

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

项目:MDT 作者: cbclab 项目源码 文件源码
def center_window(window):
    """Center the given window on the screen.

    Args:
        q_app (QApplication): for desktop information
        window (QMainWindow): the window to center
    """
    q_app = QApplication.instance()

    frame_gm = window.frameGeometry()
    screen = q_app.desktop().screenNumber(q_app.desktop().cursor().pos())
    center_point = q_app.desktop().screenGeometry(screen).center()
    frame_gm.moveCenter(center_point)
    window.move(frame_gm.topLeft())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号