raw -> smart pointer for musredit where it makes sence.
This commit is contained in:
@@ -46,22 +46,22 @@ PFitOutputHandler::PFitOutputHandler(QString workingDirectory, QVector<QString>
|
||||
return;
|
||||
|
||||
// Layout
|
||||
fVbox = new QVBoxLayout( this );
|
||||
fVbox = std::make_unique<QVBoxLayout>( this );
|
||||
//Qt.3x fVbox->resize(800, 500);
|
||||
fOutput = new QPlainTextEdit();
|
||||
fOutput = std::make_unique<QPlainTextEdit>();
|
||||
fOutput->setMaximumBlockCount(1000);
|
||||
fVbox->addWidget(fOutput);
|
||||
fVbox->addWidget(fOutput.get());
|
||||
fOutput->setMinimumSize(800, 455);
|
||||
fOutput->setReadOnly(true);
|
||||
connect( fOutput, SIGNAL( destroyed() ), this, SLOT( quitButtonPressed() ) );
|
||||
fQuitButton = new QPushButton( tr("Fitting...") );
|
||||
fVbox->addWidget(fQuitButton);
|
||||
connect( fQuitButton, SIGNAL( clicked() ), this, SLOT( quitButtonPressed() ) );
|
||||
connect( fOutput.get(), SIGNAL( destroyed() ), this, SLOT( quitButtonPressed() ) );
|
||||
fQuitButton = std::make_unique<QPushButton>( tr("Fitting...") );
|
||||
fVbox->addWidget(fQuitButton.get());
|
||||
connect( fQuitButton.get(), SIGNAL( clicked() ), this, SLOT( quitButtonPressed() ) );
|
||||
resize( 800, 500 );
|
||||
fQuitButton->setFocus();
|
||||
|
||||
// QProcess related code
|
||||
fProc = new QProcess( this );
|
||||
fProc = std::make_unique<QProcess>( this );
|
||||
|
||||
// make sure that the system environment variables are properly set
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
@@ -79,9 +79,9 @@ PFitOutputHandler::PFitOutputHandler(QString workingDirectory, QVector<QString>
|
||||
for (int i=1; i<cmd.size(); i++)
|
||||
arguments << cmd[i];
|
||||
|
||||
connect( fProc, SIGNAL( readyReadStandardOutput() ), this, SLOT( readFromStdOut() ) );
|
||||
connect( fProc, SIGNAL( readyReadStandardError() ), this, SLOT( readFromStdErr() ) );
|
||||
connect( fProc, SIGNAL( finished(int, QProcess::ExitStatus) ), this, SLOT( processDone(int, QProcess::ExitStatus) ) );
|
||||
connect( fProc.get(), SIGNAL( readyReadStandardOutput() ), this, SLOT( readFromStdOut() ) );
|
||||
connect( fProc.get(), SIGNAL( readyReadStandardError() ), this, SLOT( readFromStdErr() ) );
|
||||
connect( fProc.get(), SIGNAL( finished(int, QProcess::ExitStatus) ), this, SLOT( processDone(int, QProcess::ExitStatus) ) );
|
||||
|
||||
fProc->start(program, arguments);
|
||||
if ( !fProc->waitForStarted() ) {
|
||||
@@ -113,10 +113,6 @@ PFitOutputHandler::~PFitOutputHandler()
|
||||
qDebug() << msg << Qt::endl;
|
||||
system(cmd.toLatin1());
|
||||
}
|
||||
if (fProc) {
|
||||
delete fProc;
|
||||
fProc = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user