Results 1 to 3 of 3

Thread: Drag the paint event

  1. #1
    Join Date
    Apr 2009
    Posts
    41
    Qt products
    Qt4
    Platforms
    Windows

    Post Drag the paint event

    hi,
    i have drawn text using paint event,
    now i have to drag and drop that text. in mouse press event how can i know that position contains text and what is that text.

    plz help me in this regards

    thanks in advance

  2. #2
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Drag the paint event

    const QPoint & QMouseEvent::globalPos () const
    will return the global position of the text
    "Behind every great fortune lies a crime" - Balzac

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Drag the paint event

    Quote Originally Posted by jsmith View Post
    hi,
    i have drawn text using paint event,
    now i have to drag and drop that text. in mouse press event how can i know that position contains text and what is that text.
    There is no way to extract text from painted canvas. You have to store that text and its position in some variable.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QGraphicsScene drag event
    By rbp in forum Qt Programming
    Replies: 10
    Last Post: 13th May 2009, 14:03
  2. Replies: 4
    Last Post: 19th February 2009, 11:10
  3. QGraphicsScene doesn't enter drag event
    By Radagast in forum Qt Programming
    Replies: 8
    Last Post: 16th June 2008, 17:21
  4. Replies: 1
    Last Post: 9th June 2008, 20:41
  5. Qt text edit paint event
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 27th October 2007, 18:13

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.