void paintEvent(QPaintEvent *event)
{
//创建绘画对象
QPainter painter(this);
//设置背景图片
painter.drawImage(this->rect(), QImage(":/image/Comm_BackgroundImage.jpg"));
painter.setCompositionMode(QPainter::CompositionMode_DestinationIn);
int ImageWidth = width()/2;
int ImageHeight = (ImageWidth/16)*9;
int x = 0;
int y = (height() - ImageHeight)/2;
/** 叠加透明的矩形区域,以便显示图像 */
painter.fillRect(QRect(x, y, ImageWidth, ImageHeight), QColor(0, 0, 0, 0));
QDialog::paintEvent(event);
}