C++ (Qt)void usbController::buttonBox_ok(){ QObject *parent; QString program = "./sbin/usbController"; QStringList arguments; arguments <<lineEdit_1->text()<<" "<<lineEdit_2->text()<<" "<< "system_u:object_r:removable_t:"<<lineEdit_3->text()<<" "<<lineEdit_4->text()<<" " <<lineEdit_5->text()<<" "<<lineEdit_6->text(); QProcess *myProcess = new QProcess(parent); myProcess->start(program, arguments);}
C++ (Qt)QObject *parent;...QProcess *myProcess = new QProcess(parent);
C++ (Qt)QString program = "/sbin/usbController";QStringList arguments;arguments <<lineEdit_1->text()<<lineEdit_2->text()<<"system_u:object_r:removable_t:"<<lineEdit_3->text()<<lineEdit_4->text()<<lineEdit_5->text()<<lineEdit_6->text();QProcess *myProcess = new QProcess();myProcess->start(program, arguments);
C++ (Qt)void usbController::buttonBox_ok(){ QString program = "/sbin/usbController"; QStringList arguments; arguments <<"add"<<" "<<lineEdit_1->text()<<lineEdit_2->text()<<"system_u:object_r:removable_t:"<<lineEdit_3->text()<<lineEdit_4->text()<<lineEdit_5->text()<<lineEdit_6->text(); p_usbController->start(program, arguments); connect(p_usbController, SIGNAL(readyReadStandardOutput()), SLOT(slotDataOnStdout())); connect(p_usbController, SIGNAL(readyReadStandardError()), SLOT(slotDataOnStdout()));} void usbController::slotDataOnStdout(){ textEdit->append(p_usbController->readAllStandardOutput()); textEdit_2->append(p_usbController->readAllStandardError());}
C++ (Qt)QString program = "/bin/ls"; QStringList arguments; arguments <<"/"; p_usbController->start(program, arguments); connect(p_usbController, SIGNAL(readyReadStandardOutput()), SLOT(slotDataOnStdout())); connect(p_usbController, SIGNAL(readyReadStandardError()), SLOT(slotDataOnStdout()));
C++ (Qt)class usbController : public QDialog, public Ui::usbController{ Q_OBJECTpublic: usbController(QWidget *parent = 0); QProcess* p_usbController;public slots: void Changedtext(); void buttonBox_ok(); void slotDataOnStdout(); };