Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 86
Registered: ‎05-21-2012
My Device: Blackberry 10 Dev Alpha
My Carrier: IDEA

Method called from non UI thread

Hi!

 

       I have set the context propety for a qml document as ---

AnimationManager::AnimationManager()
{
	QmlDocument *qml_photoview = QmlDocument::create("Photoview.qml");
	qml_photoview->setContextProperty("animManager", this);

	cont_photoview = qml_photoview->createRootNode<Container>();
	cont_photoview_alias = cont_photoview->findChild<Container *>("cont_photoview");
}

void AnimationManager::swap_pictures()
{
	qDebug()<<"Swapping starts..................";
	qDebug()<<"..................................";
	qDebug()<<cont_photoview_alias->count();
}

 I have called swap_pictures() method from onTouch() signal handler of the Photoview container.

 But I am getting the log message and the application is not starting.

 

ApplicationPrivate::declarativeEngine: ERROR called from non-UI thread QThread(0x8143e48) 
ApplicationPrivate::declarativeEngine: Method called from non-UI thread

 plz tell me the way of using context properties that have been set in cpp souce files.. and provide me the solution for this error..

 

 

Thanks in advance.

 

- Regards

 

  Raju

- Raju
Developer
Posts: 526
Registered: ‎05-17-2009
My Device: 9900
My Carrier: ATT

Re: Method called from non UI thread

Where are you adding things to the screen there? I dont see any setContent() or setScene(). What is animationManager, is it its own thread? Need more context around the problem

Like all of my posts
Developer
Posts: 86
Registered: ‎05-21-2012
My Device: Blackberry 10 Dev Alpha
My Carrier: IDEA

Re: Method called from non UI thread

The problem is found. I have called the swap_pictures() method from onStarted() slot of custom animation qml file. And these custom animations are used in another custom qml component. And when I move the code to a Container's  onCreationCompleted() slot, it worked ....!

 

 

- Regards

 

 Raju

 

 

 

- Raju
Retired
Posts: 138
Registered: ‎05-11-2012
My Device: Developer
My Carrier: Developer

Re: Method called from non UI thread

Sounds like we can close this thread then?

 

Graham