
Originally Posted by
wysota
If it is empty then whatever you do (even if you get jpgs to work as Lykurg pointed out) your background won't appear.
I converted the image in png and the url is correct, now it find the correct url but I still don't see the background.
So what I have to write in the paintEvent?
Added after 6 minutes:

Originally Posted by
wysota
If it is empty then whatever you do (even if you get jpgs to work as Lykurg pointed out) your background won't appear.
I changed the paintEvent so:
{
p.
setRenderHint( QPainter::Antialiasing,
true );
// image
p.drawPixmap( 0, 0, m_pixmap );
}
void ImageRenderer::paintEvent( QPaintEvent* pe )
{
QPainter p(this);
p.setRenderHint( QPainter::Antialiasing, true );
// image
p.drawPixmap( 0, 0, m_pixmap );
}
To copy to clipboard, switch view to plain text mode
and the ctor so:
ImageRenderer
::ImageRenderer(QWidget* parent
) m_qImage(NULL)
{
setFixedSize
( QSize(640,
480) );
m_pixmap.load(":/CertiIris/images/logo.png");
}
ImageRenderer::ImageRenderer(QWidget* parent)
: QWidget(parent),
m_qImage(NULL)
{
setFixedSize( QSize(640, 480) );
m_pixmap.load(":/CertiIris/images/logo.png");
}
To copy to clipboard, switch view to plain text mode
and now I can see the background image.
So my question is: where I can use styleSheet and where not?
Regards
Bookmarks