Hi,

Currently my application repeatedly plots points to the canvas, and I need to be able to select one of the points while new points are still being plotted. This is fine when WA_PaintOutsidePaintEvent is set to false. However, when I set it to true:

canvas()->setAttribute(WA_PaintOutsidePaintEvent, true);

The QEvent::MouseButtonPress inside of the EventFilter in CanvasPicker does not get activated until the points stop plotting. Furthermore, the QEvent::MouseMove event still gets triggered even when the points are still plotting. Here is the EventFilter function:

Qt Code:
  1. bool CanvasPicker::eventFilter(QObject *object, QEvent *e)
  2. {
  3.  
  4. if ( object != (QObject *)plot()->canvas() )
  5. return false;
  6.  
  7. switch(e->type())
  8. {
  9. case QEvent::FocusIn:
  10. showCursor(true);
  11. case QEvent::FocusOut:
  12. showCursor(false);
  13.  
  14. case QEvent::Paint:
  15. {
  16. QApplication::postEvent(this, new QEvent(QEvent::User));
  17. break;
  18. }
  19. case QEvent::MouseButtonPress:
  20. {
  21. // Only capture left click
  22. if (((QMouseEvent *)e)->button() == (Qt::LeftButton))
  23. {
  24. select(((QMouseEvent *)e)->pos(), ((QMouseEvent *)e)->globalPos());
  25. return true;
  26. }
  27. }
  28. // Gets called each time mouse is moved on canvas
  29. case QEvent::MouseMove:
  30. {
  31. return true;
  32. }
  33.  
  34. default:
  35. break;
  36. }
  37. return QObject::eventFilter(object, e);
  38. }
To copy to clipboard, switch view to plain text mode 

Can somebody please tell me how to get around this problem? (So I want to set WA_PaintOutsidePaintEvent true and have QEvent::MouseButtonPress get triggered while points are continuously plotting on the graph) Thank you.