QFrame form1( 0, 0, Qt::WStyle_Customize );
form1.setFrameShape( QFrame::Box );
form1.setFrameShadow( QFrame::Raised );
form1.setMidLineWidth( 2 );
QImage img("./bitmap.png");
QPixmap pix;
pix.convertFromImage( img );
form1.setPaletteBackgroundPixmap( pix );
form1.resize( pix.width(), pix.height() );
QDesktopWidget *d = QApplication::desktop();
int w = d->width(); // 返回桌面宽度
int h = d->height(); // 返回桌面高度
if( w > form1.width() ) w = (w - form1.width() )/2; else w = 0;
if( h > form1.height() ) h = (h - form1.height() )/2; else h = 0;
form1.move( w, h );
form1.show();
// form1.close();