Low Battery
General and Desktop
5
Posts
3
Posters
2.2k
Views
1
Watching
-
Clear enough?:
In .h file:
@Q_PROPERTY(int batteryLevel READ batteryLevel WRITE setBatteryLevel NOTIFY charging)@And somewhere in class constructor
@si = new QSystemDeviceInfo(this);@
@
int myClass::getBattery()
{
this->setBatteryLevel(si->batteryLevel());
return m_batteryLevel;
}
@
[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.