mouseEvent
Hi, I need to program pool.

Right now, I'd like to make a mouseEvent so that, when i click on the screen, i get the position of the mouse.
I know to use event->x(); to get the xCoordinate, but I don't know how to impletement the clickEvent itself.

I got:

Qt Code:
  1. void mouseMoveEvent(QMouseEvent* event)
  2. {
  3. if(event->button())
  4. {
  5. xPos = event->x();
  6. yPos = event->y();
  7. }
  8. }
  9.  
  10. main
  11. {
  12. ...
  13. while(certain condition)
  14. {
  15. QMouseEvent *event;
  16. while(!(event->button()))
  17. {
  18. event;
  19. }
  20.  
  21. mouseMoveEvent(event);
  22. ...
  23. }
To copy to clipboard, switch view to plain text mode 

If I do this, it gives a segmentation fault.

I got 0 experience with implementing a mouseclick, unfortunatly :/