process_ = new KProcess(this);
process_->setOutputChannelMode( KProcess::SeparateChannels );
connect(process_, &KProcess::readyReadStandardOutput,
this, &GDB::readyReadStandardOutput);
connect(process_, &KProcess::readyReadStandardError,
this, &GDB::readyReadStandardError);
connect(process_,
static_cast<void(KProcess::*)(int,QProcess::ExitStatus)>(&KProcess::finished),
this, &GDB::processFinished);
connect(process_, static_cast<void(KProcess::*)(QProcess::ProcessError)>(&KProcess::error),
this, &GDB::processErrored);
GDB::~GDB()
{
// prevent Qt warning: QProcess: Destroyed while process is still running.
if (process_ && process_->state() == QProcess::Running) {
disconnect(process_, static_cast<void(KProcess::*)(QProcess::ProcessError)>(&KProcess::error),
this, &GDB::processErrored);
process_->kill();
process_->waitForFinished(10);
}
}
do?
Umm .. what does it do programatically or semantically? I see connections to signals and slots in Qt and callback handlers
Обсуждают сегодня