10-16-2013 06:55 AM - edited 10-16-2013 06:56 AM
How can I change UI dynamically from cpp file without reloading the qml file?
Solved! Go to Solution.
10-16-2013 06:57 AM
10-16-2013 07:04 AM - edited 10-16-2013 07:05 AM
QmlDocument *qml = QmlDocument::create("asset:///InitialRegisterScree
n.qml"); qml->setContextProperty("RoamAssist",this); AbstractPane *root = qml->createRootObject<AbstractPane>(); Sheet *sheet=root->findChild<Sheet *>("RegiSheet");
TextField* textfield = sheet->findChild<TextField*>("ph"); textfield->setText(""); textfield->requestFocus();
Textfield which is present in sheet.
I want to set focus on textfield dynamically, but not able to do it in this way.
10-16-2013 07:05 AM
yes BBSJDev is correct just to expand.
What you can do is call your http get post in cpp from qml and send a signal to your qml when you get an reponse ,
and then in qml you can connect to that signal only and do whatever updates you want to !!
10-16-2013 07:13 AM
Sorry coolneo, I am not able to get your suggestion.
If you have some sample code for this, can you please share it. I am new to blackberry so not able to understand it.
10-16-2013 07:21 AM
Are you sure you aren't creating a second instance of the Sheet? If you create and show the Sheet in QML, you'll need to find the original instance in C++ code. This thread describes a similar problem: