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: 235
Registered: ‎12-13-2011
My Device: Curve 9380
My Carrier: Vodafone-IN
Accepted Solution

Error in creating custom signal slot

My header class code 

signals:
	void newinfo(int a);
	void testing();
private slots:
void process_new_info(unsigned char[]);

 My Cpp class.


connect(this, SIGNAL(newinfo(int)), this,SLOT(process_new_info(unsigned char[])));

void APP::newinfo(int a)
{

}

 when i builded the code I am getting error saying first define here (Near to the function definition)

Thanks

Deepu George Jacob

Developer
Posts: 16,788
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Error in creating custom signal slot

change the "private" to "public"
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 543
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....
My Carrier: Telekom Slovakia

Re: Error in creating custom signal slot

[ Edited ]

You're doing it wrong
You can not send INT (void newinfo(int a) ) and receive unsigned char[] ( void process_new_info(unsigned char[]) )

 

The rest is good
private slots, signals etc...

 

Please read Signals and Slots QT

https://developer.blackberry.com/native/documentation/cascades/dev/signals_slots/



If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog
Highlighted
BlackBerry Development Advisor
Posts: 252
Registered: ‎08-17-2012
My Device: BlackBerry Z10 and Q10
My Carrier: Bell

Re: Error in creating custom signal slot

Hi Deepu_George_Jacob,

 

From the Signals and Slots documentation shared above: "To use this approach to pass information between controls, the signal and the slot need to use the same types of parameters. You can't connect a signal with afloat parameter to a slot that expects aQString parameter. Even though the types of parameters must match, the number of parameters doesn't need to."

 

So the problem in your code indeed is the mismatch between the parameter types of the signal and slog.

 

Hope that helps!

@SamarAbdelsayed

Did this answer your question? Please accept post as solution.
Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker