PDA

View Full Version : Drag the paint event



jsmith
22nd July 2009, 14:22
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

wagmare
22nd July 2009, 14:38
const QPoint & QMouseEvent::globalPos () const
will return the global position of the text

wysota
22nd July 2009, 14:51
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.