QT学习笔记
作者:互联网
1.窗体居中显示
#include "widget.h" #include <QApplication> #include <QDesktopWidget> int main(int argc, char *argv[]) { QApplication a(argc, argv); Widget w; w.show(); w.move((QApplication::desktop()->width()-w.width())/2, (QApplication::desktop()->height()-w.height())/2); return a.exec(); }
标签:QT,int,QApplication,笔记,height,学习,width,desktop,include 来源: https://www.cnblogs.com/crazyxu/p/14365652.html