Δημοσιεύτηκε: 19 Φεβ 2010, 18:36
από oxide
αυτο ειναι ενα κομματι κωδικα που εχω γραψει

Κώδικας: Επιλογή όλων
void main_gui::executeCommand_text()
{
if (!ui->textEdit->toPlainText().isEmpty())
{
savetofile();

QStringList args;
QStringList args2;
QString text;

text="-c"+QString::number(ui->spinBox->value()) + " ";
QString::number(ui->spinBox->value());
args << text;


if (ui->checkBox_2->isChecked()){ //output code
args << "-i ";

}
if (ui->checkBox->isChecked()){ //0 as \n
args << "-n ";
}
if (ui->checkBox_3->isChecked()){ //disables wrapping
args << "-w ";
}

text="-," + QString::number(ui->spinBox_2->value())+" ";
args << text;

text=ui->lineEdit_2->text() + "/bf_temp";
args << text;

if (ui->checkBox_4->isChecked()){ //Open console for input


commandProcess.start("xterm -hold -e bf",args);
// ("x-terminal-emulator",args); //diferent type of command call
}
else{



commandProcess.start("bf",args);
}
}
}


εκτελει ενα αλλο προγραμμα αναλογα με καποια checkboxes...
ολα δουλευουν καλα αλλα δεν μπορω να το κανω να ανοιγει terminal και να τρεχει το προγραμμα με τις παραμετρους...
( commandProcess.start("xterm -hold -e bf",args);)
ξερετε πως μπορει να γινει αυτο?ακομα και με αλλη εντολη...

ευχαριστω:)