Qt World Summit: Submit your Presentation

Mouse release event not received

  • Hi
    I have a widget for which I have implemented mouse press and release event handlers -

    	void mousePressEvent(QMouseEvent  *mouseEvent);
    	void mouseReleaseEvent(QMouseEvent  *mouseEvent);

    My problem is that mousePressEvent is called whereas mouseReleaseEvent is not.

    What are the possible causes of this?


  • Lifetime Qt Champion

    @GrahamLa Add "override" and see whether it builds:

    void mouseReleaseEvent(QMouseEvent  *mouseEvent) override;

    And how do you check whether it is called or not?
    Also what is the base class?

Log in to reply