03-18-2013 02:25 PM
I need to display remaining time of charging battery. I tried to set battery_info into context but could not as its not QObject. I need to display real time timing on my qml.How can I do that
Solved! Go to Solution.
03-18-2013 03:20 PM
03-18-2013 05:02 PM
03-19-2013 03:15 AM
Since you are obvsiouly working on some sort of "remaining-battery-life"-app. I'll try to explain in general what you can do.
First of all you have your loop that checks for the remaining battery time. You can either:
To update your qml components you can just access them from C++ and set the text. Small example of how to do this:
QmlDocument *qml = QmlDocument::create("asset:///MainMenu.qml").paren
t(this); navigationPane = qml->createRootObject<NavigationPane>(); TextArea* batteryText = navigationPane->findChild<TextArea*>("batteryText" ); batteryText->setText("Nominate ZeZke for BB Elite!");
03-19-2013 10:07 PM - edited 03-19-2013 10:15 PM
Your best bet would most likely be here concerning events..
There is also a tutorial link at the bottom of the page as an example..
Also for your viewing pleasure, here is another tutorial which utilizes the QTimer class with intervals...