Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, December 2006
drop poof


Message 1 in thread

I'm interested in hacking up a feature where users can drag items off
a view and they'll be removed, ideally with a poof, similar to how you
can remove items form the Dock on OSX or from toolbars when customzing
them in OSX or Firefox on any platform. How on earth can I do this? I
mean, I can easily create the drag objects when the drag begins, but
how do I detect the drop occured off widget and in response remove the
items from the view?

Will Stokes

--
 [ signature omitted ] 

Message 2 in thread

Thanks Clemens. That makes perfect sense and I was able to get that to
work. I see only two minor glitches:

1.) When the elements are dropped off the widget I can detect this and
am emitting a signal alerting the parent to remove the items etc,
however, just before they are removed you see a little animation where
the dragged elements move back on top of their old position in the
item view. How can I prevent this animation from occuring?

2.) I'd love to be able to present the poof cursor before the users
drops the elements off the widget, aka while dragging. I have no idea
how this is done but it must be possible. Qt alrady provides the
native looking plus mouse cursor badge while dragging the items over
the view they will be copied to. Perhaps what is really needed is
another drag option other than move, copy etc, that is, one for
delete.

On 12/13/06, Clemens Clausen <clausecs@xxxxxxxxxxxxxxxxxx> wrote:
> Hmm... I don't know if I got it right, but I would try using the
> mouseReleaseEvent(). There, you can estimate the position and if the
> item is outside of the view, destroy it.
>
> So, if I misunderstood you, sorry for spamming around...
>
> Clemens
>
> Will Stokes wrote:
> > I'm interested in hacking up a feature where users can drag items off
> > a view and they'll be removed, ideally with a poof, similar to how you
> > can remove items form the Dock on OSX or from toolbars when customzing
> > them in OSX or Firefox on any platform. How on earth can I do this? I
> > mean, I can easily create the drag objects when the drag begins, but
> > how do I detect the drop occured off widget and in response remove the
> > items from the view?
> >
> > Will Stokes
> >
> > --
> > To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> > "unsubscribe" in the subject or the body.
> > List archive and information: http://lists.trolltech.com/qt-interest/
> >
>

--
 [ signature omitted ]