[Qt-interest] Can I enable a user to drag and place a, for example, QPushButton on a form?

Robert Wood robert.wood at apostrophe.co.uk
Sun Feb 14 17:36:36 CET 2010


Just in case anyone else reads this and needs to do the same thing, I 
have eventually got it working.

I am not really sure it's the best piece of OO coding, but it certainly 
works nicely for me. Also, as far as I can work out, this isn't really a 
drag and drop situation more just a move situation, but I could well be 
talking out of my hat.

I have put a little explanation and the source code at the URL below in 
case anyone else looks through the archives and thinks "That's what I 
want to do!"

http://www.apostrophe.co.uk/qt/movable_widgets/moveable_widgets.html

Cheers,

Rob

Robert Wood wrote:
> Davor J. wrote:
>> You have read this right?: http://qt.nokia.com/doc/4.6/dnd.html
>>
>> Have you studied the Qt examples mentioned there?
>>
>> There is also a whole chapter about drag & drop in Blanchette's book about 
>> Qt. (The old first edition is freely distributed.) There is an example about 
>> moving QListWidgetItems from QListWidget to QListWidget if I remeber 
>> correctly.
> 
> Thanks, Davor, yes I have seen that, but couldn't get anything to 
> actually either compile, or if it did compile, if just didn't do anything!
> 
> I do have the Qt3 book, I'll dig it out and see if that helps. I guess 
> things won't have changed that much in Qt4.
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 



More information about the Qt-interest-old mailing list