• 4173阅读
  • 0回复

[提问]Qt4 怎样才能更换已显示的图片 [复制链接]

上一主题 下一主题
离线a290207265
 
只看楼主 倒序阅读 楼主  发表于: 2012-08-19
已经显示一个背景:
    QFrame *frame = new QFrame(widget);
    frame -> QWidget::setFixedSize(800,600);
    QPixmap pixmap("Image/Background_1.PNG");
    QPalette palette;
    palette.setBrush(frame -> backgroundRole(),QBrush(pixmap));
    frame -> setPalette(palette);
    frame -> setMask(pixmap.mask());
    frame -> setAutoFillBackground(true);
    frame -> move(100,100);
然后有一个按钮,摁下后执行函数change_button();
这个函数应该怎样写才能更换原来的背景(要更换的图片地址为 Image/Background_2.PNG)

新手....希望大家能耐性回答....


..不留名
快速回复
限100 字节
 
上一个 下一个