Results 1 to 8 of 8

Thread: System Command QProcess

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2008
    Posts
    21
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    3

    Default System Command QProcess

    Hello folks,

    I'll execute a system command on a Linux maschine. I've created this in a QProcess, but the result was very small.

    Qt Code:
    1. QString cmd("dpkg");
    2.  
    3. QProcess* process = new QProcess(this);
    4. process->start(QFile::encodeName(cmd).data(), QStringList() << "-l" << "| grep" << "xorg");
    5. process->waitForFinished();
    6.  
    7. QString tmp = process->readAll();
    8. qDebug() << tmp;
    To copy to clipboard, switch view to plain text mode 

    The return has a length from one line. This is wrong if I type dpgk -l | grep xorg I becomes over 20 Lines.

    If I try this:
    Qt Code:
    1. process->start(QFile::encodeName(cmd).data(), QStringList() << "-l");
    To copy to clipboard, switch view to plain text mode 

    So, with one argument all works fine, if I had more as one argument, the result ist not correctly.


    Can someone tell me how to fix the argument list?

    Thanks.

    so long
    jd

    // Sorry wrong forum, can someone move my post.
    Last edited by jd; 10th February 2009 at 15:58.
    The most difficult in the world is to live in it

Similar Threads

  1. How to get system drive?
    By Raccoon29 in forum General Programming
    Replies: 2
    Last Post: 23rd November 2008, 15:13
  2. Using QT for Digital TV menu system?
    By mittalpa in forum Newbie
    Replies: 4
    Last Post: 2nd July 2008, 20:23
  3. system() function and QProgressBar
    By rajeshs in forum Qt Programming
    Replies: 10
    Last Post: 4th June 2008, 12:50
  4. System environment variable
    By fahlen in forum Qt Programming
    Replies: 4
    Last Post: 27th November 2007, 20:02
  5. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 14:15

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.