Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
I want to move form(QWidget) by holding it from anywhere in the other form. How?
mduzoylum last edited by
I did it myself keyboard qiwdget. And I removed the frame using this code: " setWindowFlags(Qt::FramelessWindowHint) " ..
I want to move this form by holding it from anywhere in the other form.
How can i do it ?
@mduzoylum Overwrite https://doc.qt.io/qt-5/qwidget.html#mousePressEvent and https://doc.qt.io/qt-5/qwidget.html#mouseMoveEvent events
In mousePressEvent you store the mouse cursor position inside the widget. In mouseMoveEvent you check whether left mouse button in pressed, if it is you move the widget to have the mouse cursor at the same position in the widget as it was in mousePressEvent