Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. the error of sending the commend to console from qt program
Forum Updated to NodeBB v4.3 + New Features

the error of sending the commend to console from qt program

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 502 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    victor wang
    wrote on last edited by victor wang
    #1

    Hi, i'm using qt5.5 on my computer.
    I wanna send the commend like this /home/try.sh to my console.
    This is what my try.sh do inside.

    /usr/bin/ioctl weeprom 0 /home/MAC_addr.txt 256
    

    And i have try it directly through the console and it works right!

    But when i using QProccess to send the commend will always show the wrong information to me like below.

    ioctl: Bad address\n\nAX88179/AX88178A Linux EEPROM/eFuse Programing Tool v1.1.0\n
    

    And this is the program that i write in my QT APP.

     QProcess *save=new QProcess(this);
                        save->setProcessChannelMode(QProcess::MergedChannels);//victor add send command to console to sync the system
                        save->start("/home/try.sh");//victor add
    
                        if(!save->waitForStarted())//victor add
                           qWarning() << "cannaot start process";
                        ret=save->waitForFinished();
                        if(ret)
                        {
    
                            info=QString(save->readAllStandardOutput());
                        }
                        qDebug() << info;
                        delete save;
    

    Where did i doing wrong?
    Please Help!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Can you share the content of your script ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved