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
gdev001
Posts: 163
Registered: ‎01-30-2013
My Device: Blackberry 10 Simulator
Accepted Solution

strange issue Application::instance()

[ Edited ]

Hi all,

 

I have this strange issue if the following code is executed as a slot:

void myapp::SomeSlot(QString result)
{
1. Label * pChild; 2. pChild = bb::cascades::Application::instance()->findChild<Label*>("testDialogLabelUser"); 3. pChild->setText(result);
}

 it works fine. But if I have another static member function invoke the above code, on the 2. nd line, pChild is 0 -- and hence code does not work. What can be causing this any ideas?? ps. This is the static function:

 

void myapp::Wrapper_To_Call_Display(void* pt2Object, QString text)
{

    myapp* self = (myapp*) pt2Object;

      // call member
    self->SomeSlot(text);
}

 

 

 

 

Please use plain text.
Developer
gdev001
Posts: 163
Registered: ‎01-30-2013
My Device: Blackberry 10 Simulator

Re: strange issue Application::instance()

Solved.

The problem seemingly was that before the signal was emitted I was showing the QML file which contained Label testDialogLabelUser, this however was not the case anymore withth the static function ...

Please use plain text.