In my QT dialog application I need to show low battery information.
As soon as battery low I need to display low battery Icon in my application
How do I get this information in my program.
thanks in advance
In .h file:
@Q_PROPERTY(int batteryLevel READ batteryLevel WRITE setBatteryLevel NOTIFY charging)@
And somewhere in class constructor
@si = new QSystemDeviceInfo(this);@
[Edit: Code formatting; mlong]
Here is the documentation of the QSystemDeviceInfo class: http://doc.qt.nokia.com/qtmobility-1.0-tp/qsystemdeviceinfo.html
I would just use that class directly in favor of using the code suggested earlier.
In my application I am getting
- error: QSystemDeviceInfo: No such file or directory*
I have included QSystemDeviceInfo in my header file
I do @#include <QSystemDeviceInfo>@
twice - in header and in .cpp file.
Be sure to have correct .pro file:
@CONFIG += mobility
MOBILITY += systeminfo @
Learn the basis!