Part: [skip ci] cppcoreguidelines-prefer-member-initializer / cppcoreguidelines-owning-memory
This commit is contained in:
@@ -42,9 +42,11 @@ using namespace Gui::Dialog;
|
||||
* true to construct a modal dialog.
|
||||
*/
|
||||
DlgRunExternal::DlgRunExternal( QWidget* parent, Qt::WindowFlags fl )
|
||||
: QDialog(parent, fl),process(this),advancedHidden(true)
|
||||
: QDialog(parent, fl)
|
||||
, process(this)
|
||||
, advancedHidden(true)
|
||||
, ui(new Ui_DlgRunExternal)
|
||||
{
|
||||
ui = new Ui_DlgRunExternal();
|
||||
ui->setupUi(this);
|
||||
connect(ui->chooseProgram, &QPushButton::clicked, this, &DlgRunExternal::onChooseProgramClicked);
|
||||
connect(&process, qOverload<int, QProcess::ExitStatus>(&QProcess::finished),
|
||||
@@ -63,8 +65,6 @@ DlgRunExternal::DlgRunExternal( QWidget* parent, Qt::WindowFlags fl )
|
||||
*/
|
||||
DlgRunExternal::~DlgRunExternal()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void DlgRunExternal::addArgument(const QString& arg)
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#ifndef GUI_DIALOG_DlgRunExternal_H
|
||||
#define GUI_DIALOG_DlgRunExternal_H
|
||||
|
||||
#include <memory>
|
||||
#include <QDialog>
|
||||
#include <QProcess>
|
||||
#include <FCGlobal.h>
|
||||
@@ -60,7 +61,7 @@ private:
|
||||
QStringList arguments;
|
||||
QProcess process;
|
||||
bool advancedHidden;
|
||||
Ui_DlgRunExternal* ui;
|
||||
std::unique_ptr<Ui_DlgRunExternal> ui;
|
||||
};
|
||||
|
||||
} // namespace Dialog
|
||||
|
||||
Reference in New Issue
Block a user