Click here to Skip to main content
15,616,639 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
QVector<qulonglong> SysInfoLinuxImpl::cpuRawData()
QFile file("/proc/stat");;
QByteArray line = file.readLine();
qulonglong totalUser = 0, totalUserNice = 0,
totalSystem = 0, totalIdle = 0;
std::sscanf(, "cpu %llu %llu %llu %llu",
&totalUser, &totalUserNice, &totalSystem,
QVector<qulonglong> rawData;
return rawData;

What I have tried:

I tried looking at it. I am not able to get it figured out.
Updated 4-Nov-20 22:47pm
Joe Woodbury 4-Nov-20 15:29pm    
What is there to figure out? It's a Qt vector class.

It is a Qvector of type qulonglong. It has four values placed in it and it is returned from the function.

Beyond that you will have to look more closely at its implementation.
Share this answer
It reads process information from the Linux/UNIX system and extracts details of processor time spent in the various states. It returns the details in a QVector object.
Share this answer
What about the documentation: QVector Class | Qt Core 5.15.1[^] ?
See also QTL or STL? | CodeImproved[^].
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900