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: 206
Registered: ‎05-15-2012
My Device: None
My Carrier: Telus
Accepted Solution

touch SIGNAL not found

I'm continuing to have issues with the touch signal emitted by VisualNode. I'm connecting to it as follows:

 

QObject::connect(m_Title, SIGNAL(touch(TouchEvent *)),
        		this, SLOT(onTitleTouched(TouchEvent *)));

 

The console spits out the following error every time the label is touched:

Object::connect: No such signal bb::cascades::Label::touch(TouchEvent *) in ../src/xxxxxxx.cpp:121

 

The ultimate goal here is to have a ListView where each item has more than one hitbox and performs a different action when each is hit.

 

First, however, I have to be able to connect to a touch event for a label in C++. Any ideas how that can be done successfully?

----------------------
Check out my app, Alien Flow for reddit

And of course, like my post if you found it helpful or informative!
Developer
Posts: 206
Registered: ‎05-15-2012
My Device: None
My Carrier: Telus

Re: touch SIGNAL not found

For whatever reason explicitly adding the namespace (despite having it included in my source file) solved the issue:

 

    QObject::connect(m_Title, SIGNAL(touch(bb::cascades::TouchEvent*)),
                this, SLOT(onTitleTouched(bb::cascades::TouchEvent*)));

 

----------------------
Check out my app, Alien Flow for reddit

And of course, like my post if you found it helpful or informative!
Highlighted
Developer
Posts: 125
Registered: ‎06-19-2012
My Device: PlayBook + Red Z10 + BB10 Dev Alpha C
My Carrier: none

Re: touch SIGNAL not found

The namespace has to be added because you need to refer to the signal in the *exact* way as it is defined in the header file. This is because the argument to SIGNAL() is not a function prototype but a string (even though it doesn't look like a string).

Developer
Posts: 27
Registered: ‎05-15-2012
My Device: Dev Alpha B
My Carrier: Bell

Re: touch SIGNAL not found

Yes; also, do not make the mistake of putting the variable names in the connect parameters, for those new to this

Smiley Happy

 

Martin

------------------------------------------
Macadamian Technologies Inc.
http://www.macadamian.com/