I have a widget in the center of myWidget , and I used mousePressEvent() on myWidget to capture a mouse click event. I want to hide myWidget on the mouse, but not when I click inside the widget . I can calculate the position of the press on event->windowPos() , which gives QPointF , as well as ui->widget->rect() , which is QRect .
How to check if QPointF inside QRect ?
source share