方法为: QDialog* dialog = new QDialog; dialog->setParent(this, dialog->windowFlags()); dialog->show(); dialog->raise