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: 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/
Highlighted
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/