Hello.

I am creating a grid (like a graph) from a QGraphicsView adding zooming capabilities.
If i use the scrollwheel on the graphicsview, the application zoomes the view as intended.
I now want to map a button to emit a QWheelEvent signal to the graphicsview widget.
(a zoom button)

the slot function for the buttons clicked() signal.
Qt Code:
  1. // slot function for the clicked() signal of the zoombutton
  2. void DSATS::plusZoom()
  3. {
  4. std::cout << "should zoom" << std::endl;
  5.  
  6. QWheelEvent * event = new QWheelEvent(QPoint(10, 10), 120, Qt::LeftButton, Qt::NoModifier);
  7. QApplication::postEvent(dsatsGrid, event);
  8.  
  9. }
To copy to clipboard, switch view to plain text mode 

Here dsatsGrid is a subclassed QGraphicsView.


Qt Code:
  1. // wheelevent handler in the grid-class
  2. void GfxGrid::wheelEvent(QWheelEvent* event)
  3. {
  4.  
  5. std::cout << "wheelevent recieved" << std::endl;
  6.  
  7. ...
  8.  
  9. }
To copy to clipboard, switch view to plain text mode 

When i click the button, the function zoomPlus is called as expected, but the wheelevent never reaches its intended target.
I have tried with both postEvent and sendEvent, but it makes no difference. (although i know postEvent should be used because its thread safe and handles the memory)

Thank you for any help!