qt symbianプロジェクトがあり、QMainWindowの請負業者にプログラムで背景画像を設定しています。しかし、そのバグを発見しました。たとえば、そのQMainWindowを15回開いたり閉じたりすると、バックグラウンドに使用したpixmapがnullを返します。実行中にいくつかの情報を保持する静的クラスでそのpixmapを静的にしましたが、状況は改善されません。私はどんな助けにも感謝します。これがいくつかのコード例です
SettingsWindow::SettingsWindow(QWidget *parent) :
QMainWindow(parent), ui(new Ui::Settings)
{
ui->setupUi(this);
// getting screen geometry
QDesktopWidget* desktopWidget = qApp->desktop();
QRect screenGeometry = desktopWidget->screenGeometry();
ConstantVariables* pointer = ConstantVariables::CVinstance();
set image with screen geometry
QPalette* palette = new QPalette();
palette->setBrush(QPalette::Background,*(new QBrush(pointer->backGround->scaled(screenGeometry.width(),screenGeometry.height()))));
setPalette(*palette);