错误代码
this->setBackgroundBrush(QImage(":/bg3").scaled(event->size(),
1,Qt::SmoothTransformation));
正确代码
this->setBackgroundBrush(QImage(":/bg3").scaled(event->size(),
Qt::IgnoreAspectRatio,Qt::SmoothTransformation));
总结:参数二,填写错误,但是Qt会爆出 no matching member function 的错误,不要被误导,成员函数没问题,出问题的是参数。我是经过查看源码发现的。