Featured post
winapi - Windows Power State change event notification in Qt -
i developing gui in qt have show battery status icon. system power status, using windows api. show status anytime , need use thread continuously read , display power status?
i thinking of using event handler. not sure how implement. thinking 1 status icon run thread. has better suggestion, please share.
using thread might overkill, using timer might more suitable case.
qtimer can used update battery status on given interval. create qtimer object , connect it's timeout() signal slot in object, perhaps in battery state widget. in slot read new state , update icon accordingly. start qtimer instance interval of choice in milliseconds.
btw. qt mobility api can used read power state on desktop. anyway if porting not issue, might easier use api platform provides.
- Get link
- X
- Other Apps
Comments
Post a Comment