Results 1 to 3 of 3

Thread: how to do this ,mouse pressed,then can move the window

  1. #1
    Join Date
    Apr 2009
    Posts
    35
    Thanks
    9
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Android

    Default how to do this ,mouse pressed,then can move the window

    how to do this ,
    mouse pressed anywhere on the window,
    then can move the window

  2. #2
    Join Date
    Mar 2009
    Posts
    25
    Thanked 2 Times in 2 Posts

    Default Re: how to do this ,mouse pressed,then can move the window

    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.

  3. #3
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to do this ,mouse pressed,then can move the window

    read this.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

Similar Threads

  1. Replies: 7
    Last Post: 17th July 2008, 22:47
  2. How do I natively move a QWidget top-level window?
    By codeslicer in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2008, 22:08
  3. Fixing default Window position with move.
    By VireX in forum Qt Programming
    Replies: 4
    Last Post: 3rd April 2007, 22:13
  4. move parent window to the front.
    By hvengel in forum Qt Programming
    Replies: 4
    Last Post: 2nd February 2007, 09:41
  5. Move window in Clone Mode
    By ultrabrite in forum Qt Programming
    Replies: 1
    Last Post: 14th June 2006, 19:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.