MainWindow
::MainWindow(QWidget *parent
) : ui(new Ui::MainWindow)
{
ui->setupUi(this);
//connect(&process, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(pFinished(int, QProcess::ExitStatus)));
connect(&process,
SIGNAL(finished
(int,
QProcess::ExitStatus)),
this,
SLOT(pFinished
(int,
QProcess::ExitStatus)), Qt
::QueuedConnection);
process.setWorkingDirectory("C:/Users/richard.bair/Downloads/");
process.
setCreateProcessArgumentsModifier([] (QProcess::CreateProcessArguments *args
) {
args->flags |= CREATE_NEW_CONSOLE;
args->startupInfo->dwFlags &= ~STARTF_USESTDHANDLES;
});
process.start("cmd.exe", arguments);
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
//connect(&process, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(pFinished(int, QProcess::ExitStatus)));
connect(&process, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(pFinished(int, QProcess::ExitStatus)), Qt::QueuedConnection);
process.setWorkingDirectory("C:/Users/richard.bair/Downloads/");
QStringList arguments = QStringList() << "/K" << "dir";
process.setCreateProcessArgumentsModifier([] (QProcess::CreateProcessArguments *args)
{
args->flags |= CREATE_NEW_CONSOLE;
args->startupInfo->dwFlags &= ~STARTF_USESTDHANDLES;
});
process.start("cmd.exe", arguments);
To copy to clipboard, switch view to plain text mode
Bookmarks