]> git.nothing2do.fr Git - diary-mobile.git/commitdiff
a desperated attempt to get the output of my cmd, i've try Qprocess (but
authorNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Thu, 25 Feb 2016 21:07:45 +0000 (22:07 +0100)
committerNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Thu, 25 Feb 2016 21:07:45 +0000 (22:07 +0100)
don't get it)

mainwindow.cpp
mainwindow.h

index 4be98c6199bd5fa37de431db8716b1faf7f631b6..5f80936c65db85f63380c96c2688042909d8cffe 100644 (file)
@@ -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<QString, QString>;
     qDebug()<<"1' connect : "<<connect(signalmap, SIGNAL(mapped(const QString &)), this, SLOT(action(const QString &)));
     //qDebug()<<"2' connect : "<<connect(this, SIGNAL(datafilled()), this, SLOT(start()));
+    //a desperated attempt to get the output of my cmd, i've try Qprocess (but don't get it)
+    //qDebug()<<"3' connect : "<<connect(shell, SIGNAL(readyReadStandardOutput()), this, SLOT(shellReady()));
     label=new QLabel;
     setCentralWidget(screen);
     createMenuBar();
@@ -257,7 +260,13 @@ void MainWindow::action(const QString &a){
     }
     else if(b[0]==QString("cmd")){
         system(c.toStdString().c_str());
-
+        /*QStringList tmp;
+        while(!b.empty())tmp.append(b.takeFirst());
+        //shell->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"));
+}*/
index a1a16e0197d642e02e018c281182ccbe15f9cdc3..882ff256af734cb7de713f5f7f844ed9770657f4 100644 (file)
@@ -57,6 +57,7 @@
 #include <QtMultimedia/QMediaPlayer>
 #include <QtMultimedia/QMediaPlaylist>
 #include <QtMultimediaWidgets/QVideoWidget>
+//#include <QProcess>
 
 
 #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;