QDialog* dig = new QDialog(this); //dialog->setModal(TRUE); //将窗口设置为模态窗口 QHBoxLayout* layout = new QHBoxLayout(dig); QLabel* showImage = new QLabel; Pixmap Qimg; Qimg.load("c:\\img.jpg"); showImage->setPixmap(Qimg); layout->addWidget(showImage); dig->show();