Thanks for your reply Uwe. Yes, I want to have the image as background of the main window.
I've tried to overload paintEvent methods this way:
{
painter.setBackgroundMode(Qt::TransparentMode);
}
void BarChart::paintEvent(QPaintEvent *)
{
QPainter painter(this);
painter.setBackgroundMode(Qt::TransparentMode);
}
To copy to clipboard, switch view to plain text mode
{
QPixmap bkgnd
(":/files/image.png");
painter.
drawPixmap(QPoint(0,
0), bkgnd
);
}
void MainWindow::paintEvent(QPaintEvent *)
{
QPainter painter(this);
QPixmap bkgnd(":/files/image.png");
painter.drawPixmap(QPoint(0,0), bkgnd);
}
To copy to clipboard, switch view to plain text mode
But the output is:
img.JPG
Bookmarks