void MainWindow::paintEvent(QPaintEvent *w)
{
QImage im;
im.load(":/dog.jpg");
QPainter p(this);
QRect rect(0,0,this->width(),this->height());
p.drawImage(rect,im);
}
环境 Qt4.8.4 in windows vs2010
效果图:
void MainWindow::paintEvent(QPaintEvent *w)
{
QImage im;
im.load(":/dog.jpg");
QPainter p(this);
QRect rect(0,0,this->width(),this->height());
p.drawImage(rect,im);
}
环境 Qt4.8.4 in windows vs2010
效果图: