Implemented the custom button using stylesheets , now you need to read the coordinates of the button when the user pressed and held down to further move the button.
Tried to read using QMouseEvent *eventMove->global x() , but the problem is that the reading goes correctly until the user holds the button.
The mouse press option also disappears as the readout goes when the user has already released the button; this is no longer so important.

    1 answer 1

    not quite clear the task. By mousePressEvent we handle the click event, by mouseReleaseEvent - the button is released.

    Tried to read using QMouseEvent * eventMove-> global x (), but the problem is that the reading goes correctly until the user holds the button.

    what event do you read?

    The mouse press option also disappears as the readout goes when the user has already released the button; this is no longer so important.

    false, the event occurs immediately on a mousePressEvent, before the user releases the button

    • if on an empty widget, then yes, try to create a button through the designer or programmatically and therefore read the coordinates of the mouse location and you will not receive anything in return. - Tony Estakado September
    • it seems that the button has its own layout, but how to reach it is not entirely clear. - Tony Estakado September