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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


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: 17,025
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
Highlighted
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
Retired
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