PDA

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



tsuibin
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 )

e.g.

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

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