The Following 5 Users Say Thank You to krk969 For This Useful Post: | ||
![]() |
2009-12-20
, 17:51
|
|
Posts: 754 |
Thanked: 630 times |
Joined on Sep 2009
@ London
|
#2
|
Hello people,
Ive just begun my journey with QT on the maemo5 SDK.
Thought Id first try a battery percentage app and then later convert it to a desktop widget.
Im attaching the app here.
Need your help and suggestions here with it.
the app when I try running in the N900 emulator,
1. the progress bar displays 80 first, then 70,60,30,10.
Couldnt figure out why it doesnt go in steps of 10 as ive programmed it, is there some delay while using signals ?
2. as stated in my comments int he code, ive used a simple while loop to simulate the battery percentage value, anyone can suggest an mechanism where i can get an interrupt or signal when the battery percentage value changes ?
I dont want to resort to periodically polling the value returned by lshal | grep percentage, im sure there are better ways.
thanks for any help...
![]() |
2009-12-20
, 21:25
|
|
Posts: 754 |
Thanked: 630 times |
Joined on Sep 2009
@ London
|
#3
|
![]() |
2009-12-21
, 00:19
|
Posts: 3,319 |
Thanked: 5,610 times |
Joined on Aug 2008
@ Finland
|
#4
|
![]() |
2009-12-21
, 00:27
|
|
Posts: 754 |
Thanked: 630 times |
Joined on Sep 2009
@ London
|
#5
|
IIRC the event loop is started with the QApplication::exec - until that point your signals and slots might not work 'as expected', which brings us to another conclusion -> sending signals from main() is usually wrong
![]() |
2009-12-21
, 01:04
|
|
Posts: 754 |
Thanked: 630 times |
Joined on Sep 2009
@ London
|
#6
|
![]() |
2009-12-21
, 01:58
|
Posts: 236 |
Thanked: 223 times |
Joined on Oct 2009
@ NE UK
|
#7
|
~# lshal -m
Start monitoring devicelist:
-------------------------------------------------
01:17:36.433: platform_slide property button.state.value = false
01:17:36.629: platform_slide condition ButtonPressed = cover
01:17:37.119: bme property battery.reporting.current = 419 (0x1a3)
01:17:37.164: bme property battery.charge_level.percentage = 33 (0x21)
01:17:54.022: platform_slide property button.state.value = true
01:17:54.049: platform_slide condition ButtonPressed = cover
...
![]() |
2009-12-21
, 06:15
|
Posts: 66 |
Thanked: 44 times |
Joined on Nov 2009
|
#8
|
The Following User Says Thank You to kyle For This Useful Post: | ||
![]() |
2009-12-21
, 07:21
|
|
Posts: 754 |
Thanked: 630 times |
Joined on Sep 2009
@ London
|
#9
|
![]() |
2009-12-21
, 10:52
|
Posts: 39 |
Thanked: 4 times |
Joined on Nov 2009
|
#10
|
The Following User Says Thank You to n900_ag For This Useful Post: | ||
Ive just begun my journey with QT on the maemo5 SDK.
Thought Id first try a battery percentage app and then later convert it to a desktop widget.
Im attaching the app here.
Need your help and suggestions here with it.
the app when I try running in the N900 emulator,
1. the progress bar displays 80 first, then 70,60,30,10.
Couldnt figure out why it doesnt go in steps of 10 as ive programmed it, is there some delay while using signals ?
2. as stated in my comments int he code, ive used a simple while loop to simulate the battery percentage value, anyone can suggest an mechanism where i can get an interrupt or signal when the battery percentage value changes ?
I dont want to resort to periodically polling the value returned by lshal | grep percentage, im sure there are better ways.
thanks for any help...