After applaying all your hints I was able to create a working version. I used:
void MainWindow::on_actionCreate_triggered()
{
//only for Mac OS X!
QDir::setCurrent("../../../../wtorek");
connect(&p, SIGNAL(readyReadStandardOutput()), this, SLOT(showOutput()));
connect(&p, SIGNAL(readyReadStandardError()), this, SLOT(showErrors()));
p.start("tar -zcvf " + archivename + " " + filenames); --> only version working, others are having troubles with f option and filename
if(!p.waitForStarted() ) {
qDebug() << "waitForStarted failed";
return ;
}
if( !p.waitForFinished() ){
qDebug() << "waitForFinished failed";
}
p.terminate(); --> I can terminate now
}
void MainWindow::showOutput() {
ui->textEdit->append(p.readAllStandardOutput());
}
void MainWindow::showErrors() {
ui->textEdit_2->append(p.readAllStandardError());
}
void MainWindow::on_actionCreate_triggered()
{
//only for Mac OS X!
QDir::setCurrent("../../../../wtorek");
connect(&p, SIGNAL(readyReadStandardOutput()), this, SLOT(showOutput()));
connect(&p, SIGNAL(readyReadStandardError()), this, SLOT(showErrors()));
p.start("tar -zcvf " + archivename + " " + filenames); --> only version working, others are having troubles with f option and filename
if(!p.waitForStarted() ) {
qDebug() << "waitForStarted failed";
return ;
}
if( !p.waitForFinished() ){
qDebug() << "waitForFinished failed";
}
p.terminate(); --> I can terminate now
}
void MainWindow::showOutput() {
ui->textEdit->append(p.readAllStandardOutput());
}
void MainWindow::showErrors() {
ui->textEdit_2->append(p.readAllStandardError());
}
To copy to clipboard, switch view to plain text mode
But there are still some problems. Why wildcards are not accepted (example *.h)? Moreover in Mac everything is written to sdterr instead of stdout.
Bookmarks