[Tutor] PyQt4 Draggable button

Alan Gauld alan.gauld at btinternet.com
Wed Aug 26 02:02:31 CEST 2015


On 25/08/15 11:51, Ankit Pareek wrote:
> How can I create Draggable buttons in PyQt4 , which can be moved using
> mouse. Can I create using Qt Designer or I have to code.

This list is for questions about the Python language and standard 
library so PyQt is a bit off topic and you might get a better response 
asking on the PyQt 9or SIDE) forums.

However if it turns out there is not a standard "Draggable Button" 
widget it should be relatively easy to build your own. You only
need to capture the mouse drag motion (look for a drag n drop
tutorial) and then redraw the GUI once it has been dropped.

How you redraw the GUI will be up to you - for example if some
widgets have properties specifying they should be on the left
and the user drops to the left of them do you obey the
original layout rules or over-rule them for the user?

HTH
-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list