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. process readLine

process readLine

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 665 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.
  • C Offline
    C Offline
    cdcc0606
    wrote on last edited by
    #1

    I have use de a qprocess to start a soft "discover.exe", however i cannot read lines with the process. it works before, but now it doesn't work any more.
    Here is part of my code

       QString exePath;
       exePath = ("discover.exe");
    
       addpProcess->start(exePath,QIODevice::ReadWrite);
    
       if( !addpProcess->waitForStarted() ) {
           allOSB_On_Network.insert(0,"impossibletostart");
           return allOSB_On_Network;
       }
       else {
    
               QCoreApplication::processEvents();
               addpProcess->waitForReadyRead(300);
    
               dataReceive=addpProcess->readLine();
                .....
              }
    

    So in my programe, i can not read anything in the parameter dataReceive.It's always empty.
    But if i use directly the function with IP I know i can communicate with the board.

        tcpSocket->connectToHost(IP,2001,QIODevice::ReadWrite);
        tcpSocket->write(datagram);
        tcpSocket->waitForBytesWritten(300);
    
        tcpSocket->waitForReadyRead(300);
        QByteArray temp = tcpSocket->read(1);
    
    

    Anyone knows why? the process cannot read anything?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2
      • it works before, but now it doesn't work any more.

      So what did u change from there till now?

      Anyway, how does "discover.exe" get the IP?

      1 Reply Last reply
      2

      • Login

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