Qrect on frame mouse click event

  • I did qrect through frame and now I want mouseclick event on that qrect.
    Qpainter p(this);
    Qpainter path;
    Qpen pen(Qt::black,10);
    p.fillPath(path,Qt:: white);

    To this coordinates mousepress event should happen. Any solution on this please:)

  • Qt Champions 2018

    @Npsad Mouse click event on the widget you're painting on (this) and check mouse cursor coordinates in that event.

  • @jsulm I just printed co-ordinates and now at that particular coordinate only it should display say message box
    So event->pos() at that particular coordinate how to set.. any function we can use

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.