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: 22
Registered: ‎03-05-2011
My Device: Not Specified
Accepted Solution

problems with activeTabChanged signal

hi,

Ive been trying to trigger an action for when certain tabs are launched so for this i though "hey the activeTabChanged signal is perfect!" but for some reason (i am maybe implementing it in the wrong way) it never triggers the signal.

This is how I implement it:

QObject::connect(tabbedPane, SIGNAL(activeTabChanged(Tab*)),this, SLOT(sectionTriggered(Tab*)));

 

void App:: sectionTriggered(bb::cascades::Tab* activeTab) {

activeListURL = activeTab->objectName();

 

getList();

}

Am i missing something? I debug and put a break point in the slot but it never reaches the point...

 

Developer
Posts: 589
Registered: ‎10-17-2010
My Device: (BlackBerry Z10)-> Q10/Passport Dual Use

Re: problems with activeTabChanged signal

Did you remember to prototype the slot in your header .hpp or .h file?

Add this:

public slots:
   void sectionTriggered(bb::cascades::Tab* activeTab);

 
Recompile and post findings.

Good luck!

 

Highlighted
Developer
Posts: 22
Registered: ‎03-05-2011
My Device: Not Specified

Re: problems with activeTabChanged signal

I hope my error was as simple as that, i do have declared the slot in the app.hpp. Still the slot is never reached...

Developer
Posts: 22
Registered: ‎03-05-2011
My Device: Not Specified

Re: problems with activeTabChanged signal

Ok, i just found the solution just had to connect the signal like this:

QObject::connect(tabbedPane, SIGNAL(activeTabChanged(bb::cascades::Tab*))thisSLOT(sectionTriggered(bb::cascades::Tab*)));

(including the "bb::cascades::" part) even though the qde outlines it as an error...