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
Contributor
Posts: 12
Registered: ‎04-23-2013
My Device: Z30
My Carrier: Truphone
Accepted Solution

postEvent to ImageButton not working

(continued from http://supportforums.blackberry.com/t5/Cascades-Development/Automated-Integration-Testing/m-p/232630...)

 

I've managed to record TouchEvents (their screen x/y, window x/y, local x/y) and their receiver and target objects. However, when I try and create a new TouchEvent and post it back to the receiver I get a Message Handler warning of:

 

Trying to send event unknown receiver: "Event[Touch] Time[08:53:30:841] Phase[142743258] Type[0] Screen[149,176] Window[149,176] Local[149,176]" 

 using the code:

...
TouchEvent * te = new TouchEvent(TouchType::Type(touchType), sx, sy, wx, wy, lx, ly, visualObject);
QCoreApplication::postEvent(receiverObject, te);
...

 I have tried all combinations of posting - posting to the Application (bb::cascades), posting to the scene, posting to the receiver and the target itself but I always get the same error.

 

What am I missing to inject touch events?

Contributor
Posts: 12
Registered: ‎04-23-2013
My Device: Z30
My Carrier: Truphone

Re: postEvent to ImageButton not working

Is this related to http://www.qtcentre.org/threads/17696-postEvent-and-multithreading? Do events need to originate from the same event queue thread?
Highlighted
Contributor
Posts: 12
Registered: ‎04-23-2013
My Device: Z30
My Carrier: Truphone

Re: postEvent to ImageButton not working

I've done this and no change - however I have noticed that the Phase (I assume this is the Propogation Phase) is just a crazy value - yet it isn't on the constructor list and I can't see a way to initialise it to a sensible value.
Contributor
Posts: 12
Registered: ‎04-23-2013
My Device: Z30
My Carrier: Truphone

Re: postEvent to ImageButton not working

QMetaObject::invokeMethod(visualObject, "touch", Q_ARG(bb::cascades::TouchEvent*,te));

 This essentially fires the touch event straight to the object (ignoring the receiver for now - I might try and hook that up) but right now the propogation of using postEvent (i.e. the proper way that seems to work on QT4 with Hooq etc) doesn't seem to work with Cascades.