View Full Version : how to do this ,mouse pressed,then can move the window

2nd April 2009, 19:39
how to do this ,
mouse pressed anywhere on the window,
then can move the window

Hiker Hauk
2nd April 2009, 19:45
Implement the 2 methods below for your derived class from QWidget.

virtual void mouseMoveEvent ( QMouseEvent * event )
virtual void mousePressEvent ( QMouseEvent * event )


in moursePress, set a flag,
in mouseMove, if flag set, move the window by calculating how much mouse is moved.

2nd April 2009, 20:04
read this (http://labs.trolltech.com/blogs/2009/03/20/moving-top-level-window-by-dragging/).