Results 1 to 2 of 2

Thread: Drag Text on QPainter with left button of mouse movement

  1. #1
    Join Date
    Jun 2011
    Posts
    22
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Drag Text on QPainter with left button of mouse movement

    Hi...

    I have drawed text on QPaint with QPainterPath.I have all the co-ordinates of the text.Now i want to drag text on QPaint with left mouse button.

    So please tell me the solution of this problem.
    Waiting for quick reply..

    Thanks.
    Amit

  2. #2
    Join Date
    Jun 2011
    Location
    Finland
    Posts
    164
    Thanks
    1
    Thanked 26 Times in 26 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: Drag Text on QPainter with left button of mouse movement

    You must reimplement mouseMoveEvent, check what buttons are pressed and if left button is pressed then change the text coords by the offset between lastPos() and pos() and call update();

Similar Threads

  1. Replies: 4
    Last Post: 29th August 2010, 18:16
  2. Drag/Drop on middle mouse button?
    By joeld42 in forum Qt Programming
    Replies: 0
    Last Post: 21st August 2010, 00:20
  3. Registering QGraphicsItem Movement (Drag)
    By Polnareff in forum Newbie
    Replies: 5
    Last Post: 27th May 2010, 13:41
  4. combining Alt + Left Mouse Button
    By speedracer in forum Qt Programming
    Replies: 1
    Last Post: 3rd June 2009, 13:29
  5. Game mouse movement
    By chaosgeorge in forum Qt Programming
    Replies: 1
    Last Post: 2nd December 2006, 23:41

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.