QModelIndexList currentSelection = tableWidget->selectionModel()->selectedIndexes(); for ( int i = 0; i < currentSelection.count(); ++i){ if ( currentSelection.at(i).column() == 1 ) {continue;} int roow = currentSelection.at(i).row(); nameBase = tableWidget->item(roow, 0)->text(); qDebug() << nameBase; emit proc();void sevice::reindex(){ QString rex = ("g"); rex = rex.arg(nameBase, dbNamer, pr); //textBrowser->clear(); textBrowser->append(rex); serviceP.start(rex); cansel->setEnabled(true);
connect(&serviceP, SIGNAL(readyReadStandardOutput()), this, SLOT(updateOutputTextEdit()));void sevice::updateOutputTextEdit(){ QByteArray newData = serviceP.readAllStandardOutput(); QString text = textBrowser->toPlainText() + QString::fromLocal8Bit(newData); textBrowser->setPlainText(text); scrolDown();}
C++ (Qt)serviceP.push_back(new QProcess());serviceP.back()->start(rex);
C++ (Qt)QProcess * theProc = 0;..if (theProc) { // ага, процесс еще живет.. }else { theProc = new QProcess(); // создаем и запускаем theProc->start(arg);}..delete theProc; // отработал, удаляем и зачищаем указательtheProc = 0;