Hello,
I get a segmentation fault on the setCentralWidget() call in the SetBackground() slot, that is when the QMainWindow attempts to change the central widget. I do know that it tries to delete the widget but do not understand how to cope with that. Please help!

class myClass : public QMainWindow
{
Q_OBJECT

QImage fond;
QLabel *wfond;
};

myClass::myClass()
: QMainWindow()
{
this->fond.load("somepic.jpg");
this->wfond = new QLabel;
this->wfond->setPixmap(QPixmap::fromImage(this->fond));
this->setCentralWidget(this->wfond);
}

void
myClass::SetBackground(QImage im)
{
this->fond = im;
this->wfond = new QLabel;
this->wfond->setPixmap(QPixmap::fromImage(this->fond));
this->setCentralWidget(this->wfond);
}