Skip to content

Commit

Permalink
move window to desktop center
Browse files Browse the repository at this point in the history
  • Loading branch information
yangfuyuan committed Jun 2, 2019
1 parent b947a91 commit 06164fd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ int main(int argc, char *argv[])
file.close();
MainWindow w;
w.show();
w.move((QApplication::desktop()->width() - w.width()) / 2,
(QApplication::desktop()->height() - w.height()) / 2);
return a.exec();
}

0 comments on commit 06164fd

Please sign in to comment.