QT设置背景图片以及设置按钮

1.Qt设置背景图片

         ①。设置UI窗口背景图片,需要在构造函数中添加以下代码:
         this-> setAutoFillBackground(true);
         QPalette palette = this-> palette();

         Palette.setBrush(Qpalette ::窗口,QBrush(QPixmap的( “:RES / picture.png”)。

         缩放(这 - >尺寸

你可能感兴趣的:(Qt,Qt设置背景图片)