If you want to run your shell script in the button handler, you need to use function int QProcess::execute ( const QString & program, const QStringList & arguments ). In above example from Nathraiben you would call it in function hello like this: Code: void MainWindow::hello() { QStringList arguments; arguments << "Enable custom transitions" << "Droid Sans" << "Black"; QProcess::execute("/path/to/my/script/script.sh", arguments); }
void MainWindow::hello() { QStringList arguments; arguments << "Enable custom transitions" << "Droid Sans" << "Black"; QProcess::execute("/path/to/my/script/script.sh", arguments); }
connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(hello()));