8000 Qt 窗口居中显示 · Issue #41 · holdyounger/ScopeBlog · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Qt 窗口居中显示 #41
Open
Open
@holdyounger

Description

@holdyounger

Qt 窗口居中显示

一、进行界面布局的时候,往往需要将界面显示在整个桌面的中心位置,所以需要进行一下处理

二、加上头文件

#include <QDesktopWidget>

三、再在构造函数中加上代码

 QDesktopWidget *deskdop=QApplication::desktop();
 move((deskdop->width()-this->width())/2, (deskdop->height()-this->height())/2);

blog link Qt 窗口居中显示

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0