From e6a9ebf692cd443ae45b6a4699efd998d3af1c0f Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Sat, 30 Nov 2024 22:26:03 +0800 Subject: [PATCH] set widget owneship in mainwindow --- RedPandaIDE/mainwindow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 0c3695cfa..5e1d79c98 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -151,9 +151,9 @@ MainWindow::MainWindow(const QStringList& filesToOpenAfterStart, QWidget *parent // status bar //statusBar takes the owner ships - mFileInfoStatus=new QLabel(); - mFileEncodingStatus = new LabelWithMenu(); - mFileModeStatus = new QLabel(); + mFileInfoStatus=new QLabel(this); + mFileEncodingStatus = new LabelWithMenu(this); + mFileModeStatus = new QLabel(this); mFileInfoStatus->setStyleSheet("margin-left:5px; margin-right:5px"); mFileEncodingStatus->setStyleSheet("margin-left:5px; margin-right:5px"); @@ -186,7 +186,7 @@ MainWindow::MainWindow(const QStringList& filesToOpenAfterStart, QWidget *parent mVisitHistoryManager->load(); //toolbar takes the owner - mCompilerSet = new QComboBox(); + mCompilerSet = new QComboBox(this); mCompilerSet->setMinimumWidth(200); mCompilerSet->setSizeAdjustPolicy(QComboBox::AdjustToContents); ui->toolbarCompilerSet->insertWidget(ui->actionCompiler_Options, mCompilerSet);