October 21, 2010

genjix genjix
Lab Rat
20 posts

Should I report this bug?

 

Hey,

I think this is a bug, but someone else on IRC said it isn’t, so I’m not sure whether to report it or not?

If I install an event filter on QGraphicsView, then it will call it’s super-class QAbstractScrollableBase before calling my event filter. In that way, it is impossible for me to block scroll events to QGraphicsView. IMO QGraphicsView should call my event filter before QASB. The solution, is just to sub-class QGraphicsView and override the event you’re interested in.

3 replies

October 21, 2010

Alexander Kuchumov Alexander Kuchumov
Lab Rat
380 posts

which function of QAbstractScrollArea does it call? What do you mean?

October 21, 2010

genjix genjix
Lab Rat
20 posts

oh sorry, I meant wheelEvent(event)

October 24, 2010

Deleted Member # 4a2 Deleted Member # 4a2
Ant Farmer
1481 posts

This is explained by this code in qgraphicsview.cpp

  1. void QGraphicsView::wheelEvent(QWheelEvent *event)
  2. {
  3.     Q_D(QGraphicsView);
  4.     if (!d->scene || !d->sceneInteractionAllowed) {
  5.         QAbstractScrollArea::wheelEvent(event);
  6.         return;
  7.     }
  8.  
  9.     event->ignore();

 
  ‹‹ QToolBox overlapped on top of window      QUiLoader in QtScript won’t load a .ui file ››

You must log in to post a reply. Not a member yet? Register here!