1. QPalette的方法
#include <QApplication>#include <QtGui>
int main(int argc, char *argv[]){ QApplication app(argc,argv); QFrame *frame = new QFrame; frame->resize(400,700); QPixmap pixmap("images/frame.png"); QPalette palette; palette.setBrush(frame->backgroundRole(),QBrush(pixmap)); frame->setPalette(palette); frame->setMask(pixmap.mask()); //可以将图片中透明部分显示为透明的 frame->setAutoFillBackground(true); frame->show......
阅读全文