int cx, cy; //当parent为空时,窗口就显示在桌面中央 if( NULL == parent ) { cx = (QApplication::desktop()->width() - width()) / 2; cy = (QApplication::desktop()->height() - height()) / 2; } //否则,控件就显示在父部件中央 else { cx = ( parent->width() - width() ) / 2; cy = ( parent->height() - height() ) / 2; } move(cx, cy);
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。