In my app I use a qprocess which starts on button clicked event in mainwindow.
public :
QProcess commandProcess;
// mainwindow.h
public :
QProcess commandProcess; // mainwindow.h
To copy to clipboard, switch view to plain text mode
I also got a Qdialog which has a Stop button in it. Now when the user clicks stop button the qprocess in the mainwindow must stop, but it aint stopping.
I tried connecting it as below:
dialog.cpp
void dialog::on_StopButton_clicked()
{
MainWindow *mainwin=new MainWindow(this);
connect(ui->StopButton,SIGNAL(clicked()),mainwin,SLOT(on_stopButton_clicked()));
}
void dialog::on_StopButton_clicked()
{
MainWindow *mainwin=new MainWindow(this);
connect(ui->StopButton,SIGNAL(clicked()),mainwin,SLOT(on_stopButton_clicked()));
}
To copy to clipboard, switch view to plain text mode
mainwindow.cpp
void MainWindow::on_stopButton_clicked()
{
commandProcess.kill(); //even tried commandProcess.close();
ui->progressBar->hide();
}
void MainWindow::on_stopButton_clicked()
{
commandProcess.kill(); //even tried commandProcess.close();
ui->progressBar->hide();
}
To copy to clipboard, switch view to plain text mode
but the qprocess is not stopping......plzz help.........
Bookmarks