[Qt-interest] qprocess problem
henry cui
hhenry.cui at gmail.com
Sun Mar 6 05:01:53 CET 2011
sorry missed one line last time.
list is a variable that read output from process.
________________________________________________________
QProcess process;
process.setReadChannel(QProcess::StandardOutput);
process.setReadChannelMode(QProcess::MergedChannels);
process.startDetached(QString("wmic process where name='system' get
Caption,WorkingSetSize,PrivatePageCount,Handlecount,ThreadCount
/format:value"));
process.waitForStarted();
process.waitForFinished();
QByteArray list = process.readAll();
qDebug()<<list;
//list get nothing from window server 2003,but I can see the correct
output infomation in the black cmd window
//but list can get right response under window 7
_______________________________________________________
2011/3/6 henry cui <hhenry.cui at gmail.com>
> I got question for QProcess,code as following,these code can work fine
> under window 7,but under window server 2007,there is nothing
> in variable list ,
> I don't know why,it's seem to be that list read nothing from cmd
> process,anyone can help will be much more appreciative
>
> QProcess process;
> process.setReadChannel(QProcess::StandardOutput);
> process.setReadChannelMode(QProcess::MergedChannels);
> process.startDetached(QString("wmic process where name='system' get
> Caption,WorkingSetSize,PrivatePageCount,Handlecount,ThreadCount
> /format:value"));
> process.waitForStarted();
> process.waitForFinished();
> qDebug()<<process.readAll();
> qDebug()<<list;
>
>
> --
> best,
> henry cui
>
--
best,
henry cui
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110306/104c25d7/attachment.html
More information about the Qt-interest-old
mailing list