Hello, i was trying the QProcess class with a simple program, i made an interface to call mogrify program and convert an image. This is the code used to start the process:
void ConvertDialog::on_convertButton_clicked()
{
QString sourceFile
= sourceFileEdit
->text
();
convertButton->setEnabled(false);
outputTextEdit->clear();
QString size
= "-resize " + sizeComboBox
->currentText
().
toLower();
args << size << sourceFile;
QString commandDebug
= "command: ";
int i;
for(i = 0; i < args.size(); i++){
commandDebug += args.at(i);
}
textBrowser->setText(commandDebug);
process.start("mogrify", args);
}
void ConvertDialog::on_convertButton_clicked()
{
QString sourceFile = sourceFileEdit->text();
convertButton->setEnabled(false);
outputTextEdit->clear();
QStringList args;
QString size = "-resize " + sizeComboBox->currentText().toLower();
args << size << sourceFile;
QString commandDebug = "command: ";
int i;
for(i = 0; i < args.size(); i++){
commandDebug += args.at(i);
}
textBrowser->setText(commandDebug);
process.start("mogrify", args);
}
To copy to clipboard, switch view to plain text mode
when i start it, it shows me this error:
mogrify: unrecognized option `-resize 800x600'.
but this option is available on mogrify. Any ideas?
Bookmarks