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
alupimp
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...

 

Please use plain text.
Developer
greenback
Posts: 514
Registered: ‎10-17-2010
My Device: BlackBerry Z10, DAC

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!

 

Please use plain text.
Developer
alupimp
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...

Please use plain text.
Developer
alupimp
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...

Please use plain text.