I am currently developing an application using qt targeting a tablet running ubuntu 14.04
Since there is only a poor battery indicator on the device and the application will run fullscreen for prolonged time, I want to show an battery indicator inside the application. A search found mainly old results or calls to windows, android or ios apis.
Is there any way using just the Qt apis or an other comfortable way to get information about the battery state?
Even though user vahanchos answer was helpful for me, and probably is the way to go for others, I ended up with a different solution.
In my case I code for only one special device type and a known set of development machines. therefore I could just read the relevant files in
sys/class/power_supply/
. I can not guarantee that other devices will name their files there exactly the same. But it might be worth the try.