From 48ffeea6a2a85d2fe990cf9df14ebe34dcdeb1b1 Mon Sep 17 00:00:00 2001 From: Norbert Moutarde Date: Thu, 25 Feb 2016 22:07:45 +0100 Subject: [PATCH] a desperated attempt to get the output of my cmd, i've try Qprocess (but don't get it) --- mainwindow.cpp | 15 ++++++++++++++- mainwindow.h | 3 +++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 4be98c6..5f80936 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -62,9 +62,12 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) grid=new QGridLayout(screen); grid->setSizeConstraint(QLayout::SetMinAndMaxSize); signalmap=new QSignalMapper(this); + //shell=new QProcess(this);a desperated attempt to get the output of my cmd, i've try Qprocess (but don't get it) valeur=new QMap; qDebug()<<"1' connect : "<setProgram(QString("/bin/sh")); + //shell->setArguments(tmp); + shell->start("/bin/sh", tmp); + shell->waitForFinished(); + a desperated attempt to get the output of my cmd, i've try Qprocess (but don't get it)*/ } else if(b[0]==QString("sav")){ Msav.lock(); @@ -666,6 +675,7 @@ void MainWindow::firstrun(){ conf->setValue(QString("multiline"), QVariant(0)); conf->setValue(QString("startdefault"), QVariant("begin")); conf->setValue(QString("actionmenu"), QVariant("-menuback")); + //conf->setValue(QString("process"), QVariant(0)); d.unlock(); qDebug()<<"firstrun() finished"; } @@ -1275,3 +1285,6 @@ void MainWindow::get2(const QString & d, const QString &b){ printItem(*qq); //} } +/*void MainWindow::shellReady(){ + QMessageBox::information(this, QString("shell"), QString("shell ready")); +}*/ diff --git a/mainwindow.h b/mainwindow.h index a1a16e0..882ff25 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -57,6 +57,7 @@ #include #include #include +//#include #ifndef FILEDOWNLOADER_H @@ -190,6 +191,7 @@ private slots: void download(const QString &,const QString &); void use(const QString &); bool printItem(const QSqlQuery &); + //void shellReady();a desperated attempt to get the output of my cmd, i've try Qprocess (but don't get it) public slots: signals: @@ -199,6 +201,7 @@ private: //sax2 xml; //QsKineticScroller * ks; //QScrollArea * scroll; + //a desperated attempt to get the output of my cmd, i've try Qprocess (but don't get it)QProcess *shell; QMediaPlayer *video; QMediaPlaylist *playlist; QMutex sql,updatelocker,d,Msav; -- 2.45.1