添加背景图片

来源:互联网 发布:淘宝权为什么叫逃跑权 编辑:程序博客网 时间:2024/06/02 21:17

// 添加一个全屏幕的背景图片

//        QPalette p = palette();

//

//        //Load image to QPixmap, Give full path of image

//       QPixmap pixmap1("green.jpg"); //For emulator C: is ../epoc32/winscw/c so image must be at that location

//

//       //resize image if it is larger than screen size.

//       QDesktopWidget* desktopWidget = QApplication::desktop();

//       QRect rect = desktopWidget->availableGeometry();

//

//       QSize size(rect.width() , rect.height());

//       //resize as per your requirement..

//       QPixmap pixmap(pixmap1.scaled(size));

//

//       p.setBrush(QPalette::Background,  pixmap);

//       setPalette(p);

 

 

原创粉丝点击