Skip to content

Instantly share code, notes, and snippets.

@LeShadow
Created June 8, 2014 17:43
Show Gist options
  • Save LeShadow/3c6330dddb507e675648 to your computer and use it in GitHub Desktop.
Save LeShadow/3c6330dddb507e675648 to your computer and use it in GitHub Desktop.
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QProcess>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
this->process = new QProcess(this);
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_pushButton_clicked()
{
QString program = "gnome-terminal -x sh -c 'make clean; make; ./PSE; exec bash'";
this->process->startDetached(program);
process->waitForFinished();
}
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QProcess>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void on_pushButton_clicked();
private:
Ui::MainWindow *ui;
QProcess *process;
};
#endif // MAINWINDOW_H
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment