if (widget->geometry().contains(point)) {}
QT determines whether the mouse is over a subwindow control
It should be noted that the geometry obtained by the child window is the relative position relative to the parent window. QCursor::pos() obtains the absolute position of the mouse. Either convert the relative position of the parent window or convert the absolute position of the mouse. For conversion, this article uses the conversion of the absolute position of the mouse to the control. The sample code is as follows:
if(ui->groupBox->geometry().contains(this->mapFromGlobal(QCursor::pos())))