Results 1 to 6 of 6

Thread: Shell command from Qt 4.5.2 by QProcess

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    6
    Thanked 348 Times in 333 Posts

    Default Re: Shell command from Qt 4.5.2 by QProcess

    Quote Originally Posted by Rajeshsan View Post
    i need to see all list of folders or dir on Root file system(rfs).
    Use QDir in this case.

    If you wish to send other commands, then refer to QProcess documentation. Note that arguments must be seperate from the command to be executed (look at QStringList).

  2. #2
    Join Date
    Sep 2009
    Posts
    39
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    3

    Arrow Re: Shell command from Qt 4.5.2 by QProcess

    Sorry.. Actually I wanted to implement on my board fast. so im searching fastly. I thot of replying you but now im getting partial outputs. So I'm eager to do fast. Now im able to get cmd.exe(wiindows) or terminal.exe(linux).just proc->start("cmd.exe/terminal.exe"). I need to send command to same terminal or command prompt directly from same program or window. I studied full documentation but i didmt suceed in sending commands to it. So I dont no how exactly it happens. I have sent code. QDir i implented as you suggested but it didnt work. Sorry.

  3. #3
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    6
    Thanked 348 Times in 333 Posts

    Default Re: Shell command from Qt 4.5.2 by QProcess

    Why not run each command seperately? It would be much easier. For example, 'dir' command can be run like:
    Qt Code:
    1. p.start("cmd.exe", QStringList() << "/c" << "dir");
    2. if (p.waitForStarted())
    3. {
    4. p.waitForFinished();
    5. qDebug() << p.readAllStandardOutput();
    6. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. QProcess & linux shell characters
    By Ti_Thom in forum Qt Programming
    Replies: 4
    Last Post: 21st December 2009, 11:01
  2. qprocess and shell
    By GuL in forum Qt Programming
    Replies: 1
    Last Post: 12th February 2009, 06:47
  3. Detect First QProcess finished in a group and kill other
    By Davidaino in forum Qt Programming
    Replies: 3
    Last Post: 11th July 2008, 13:53

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.