Results 1 to 4 of 4

Thread: current Cpu(s) usage info

  1. #1
    Join Date
    Oct 2007
    Location
    Poland
    Posts
    17
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default current Cpu(s) usage info

    How can i get this info ? or how can i get this via KProcess and top command, because

    Qt Code:
    1. KProcess p;
    2. p->setProgram( "top", QStringList() );
    3. p->start();
    To copy to clipboard, switch view to plain text mode 

    and readAllStandardOutput() doesn't work.
    Last edited by jpn; 15th January 2008 at 17:18. Reason: missing [code] tags

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: current Cpu(s) usage info

    The process works in an asynchronous way. You can start it and immediately read the result - it's not there. Connect to a proper signal instead.

  3. #3
    Join Date
    Oct 2007
    Location
    Poland
    Posts
    17
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: current Cpu(s) usage info

    i konw that. I have error "top: failed tty get" . Any idea?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: current Cpu(s) usage info

    Apparently it needs a real terminal. Try using uptime instead of top or parse /proc/stat yourself.

Similar Threads

  1. Distributing QT application for Mac OS
    By mb0 in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2007, 18:59
  2. Replies: 15
    Last Post: 21st April 2007, 17:46

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.