Originally Posted by
IRON_MAN
It was a problem of my programm. I have solved it!
But, if I maximize the window , the image appears once,twice... and it doesn´t suit to the window. My image is .bmp
QPalette pal = widget.palette();
pal.setBrush( QPalette::Window, QPixmap("image.bmp"));
widget.setPalette( pal );
re implement resizeEvent and resize your image to desired size
{
pal.
setBrush( QPalette::Window, pix.
scaled(e
->size
(),...,...
) );
widget.setPalette( pal );
}
void MyWidget::resizeEvent(QResizeEvent* e)
{
static QPixmap pix("image.bmp");
QPalette pal = widget.palette();
pal.setBrush( QPalette::Window, pix.scaled(e->size(),...,...) );
widget.setPalette( pal );
}
To copy to clipboard, switch view to plain text mode
Bookmarks