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
Highlighted
Developer
Posts: 44
Registered: ‎06-16-2012
My Device: BB10 Dev Alpha

Intermittent QPanGesture/QPinchGesture?

Hi,

I've got a problem reliably catching QPanGestures/QPinchGestures from a QGLWidget. These work intermittently depending on the instance of the app (i.e. it works for one instance but not another).

I use setAttribute(Qt::WA_AcceptTouchEvents,true); in the constructors of the QGLWidget through to app level to accept these events.  

Does anyone have any ideas please?

----------------------------------------------------------------------------------
Blog: http://partialpivot.blogspot.co.uk/
Developer
Posts: 44
Registered: ‎06-16-2012
My Device: BB10 Dev Alpha

Re: Intermittent QPanGesture/QPinchGesture?

Bump! I'm still getting intermittent gesture recognition and I'm wondering if anyone can help please? (Note: this works okay on the Nokia N9 if that makes anyone bite!)

 

I am using Qt/C++ and have a QMainWindow with a child QGLWidget displaying a 3D model. In the QMainWindow constructor I call:

    grabGesture(Qt::PinchGesture, Qt::ReceivePartialGestures);

These events are handled by the QMainWindow:

 

bool CGUI_FEVMob::event(QEvent *event){
   if (event->type()==QEvent::Gesture){
       return gestureEvent(static_cast<QGestureEvent*>(event));
   }
   return QWidget::event(event);
} // End event

bool CGUI_FEVMob::gestureEvent(QGestureEvent *event){
   if (QGesture *pan = event->gesture(Qt::PanGesture)){
      panGesture(static_cast<QPanGesture *>(pan));
      event->accept(Qt::PanGesture);
   }
   if (QGesture *pinch = event->gesture(Qt::PinchGesture)){
         pinchGesture(static_cast<QPinchGesture *>(pinch));
         event->accept(Qt::PinchGesture);
   }
   return true;
} // End gestureEvent()

In about 50% of instances the window behaves as expected. In the other 50% the gestures are ignored. I've tried various permutations of grabGesture (including using grabGesture in the QGLWidget constructor and setting the Qt::IgnoredGesturesPropagateToParent flag) but have not been able to solve this yet.

 

Does anyone have any ideas please?

 

Thanks in advance.

----------------------------------------------------------------------------------
Blog: http://partialpivot.blogspot.co.uk/
Developer
Posts: 44
Registered: ‎06-16-2012
My Device: BB10 Dev Alpha

Re: Intermittent QPanGesture/QPinchGesture?

[ Edited ]

I raised this as a bug:

 

https://www.blackberry.com/jira/browse/BBTEN-677

----------------------------------------------------------------------------------
Blog: http://partialpivot.blogspot.co.uk/