Learner
Learner

Reputation: 67

Qt based GUI to execute a shell script

Hi I have written an application in QT, which is supposed to execute a script, written already on ubuntu 14.04, but its not performing the function as desired. This is the piece of code which I have written.

void MainWindow::on_pushButton_clicked()
{
    QProcess process ;
    process.startDetached("/bin/bash", QStringList() << "path to file.sh");
}

What I am missing here? Thanx for valuable suggestions.

Upvotes: 0

Views: 1555

Answers (1)

Learner
Learner

Reputation: 67

I found the mistake, actually the code works well. When i press the button the GUI creates a new file in the same directory, but i have written the script in home directory. So i was expecting the new file in home directory, but it was already there in project directory.

Upvotes: 1

Related Questions