How to obtain the battery design capacity of a laptop?
-
I want to know how to obtain the design capacity of the computer battery. I have tried using the wmic command and calling the Windows API, and I have tried it all but failed.
-
@YUTONG If Windows
wmic
fails I'm not sure what Qt can do about that. It's very Windows-specific.You can find an example in the msdn documentation. It already queries the correct InformationLevel (BatteryInformation).
-
You can find an example in the msdn documentation. It already queries the correct InformationLevel (BatteryInformation).
@Christian-Ehrlicher
I tried to find the function 'GetSystemPowerStatus' from msdn and extracted the design capacity of the battery from it. But my computer cannot display the numerical value of the designed capacity. -
@Christian-Ehrlicher
I tried to find the function 'GetSystemPowerStatus' from msdn and extracted the design capacity of the battery from it. But my computer cannot display the numerical value of the designed capacity.@YUTONG said in How to obtain the battery design capacity of a laptop?:
But my computer cannot display the numerical value of the designed capacity.
What does this mean?
-
@YUTONG said in How to obtain the battery design capacity of a laptop?:
But my computer cannot display the numerical value of the designed capacity.
What does this mean?
@Christian-Ehrlicher The program runs without any errors, but does not display the output value, which is a null value.
Like this, it doesn't output any values after it
-
@Christian-Ehrlicher The program runs without any errors, but does not display the output value, which is a null value.
Like this, it doesn't output any values after it
And how should we help you when you post a screenshot of your app instead the relevant code.
-
And how should we help you when you post a screenshot of your app instead the relevant code.
-
Please stop posting images but your code with the proper code tags.
Your code prints something to stdout and not to a widget from your former post. What do you expect? That stdout is magically redirected to your widget?