void Widget::paintEvent(QPaintEvent *)
{
QPixmap pixmap = QPixmap(":/1/main.png").scaled(this->size());
QPainter painter(this);
painter.drawPixmap(this->rect(), pixmap);
// btn1->move(this->width()-500,this->height()-0);
btn3->move(this->width()-55,0);
}
简单易懂!琢磨了半天,参考了各大佬的想法!!!