[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: drag and drop proxy object
From:       Matthias Ettrich <ettrich () troll ! no>
Date:       1999-07-14 12:49:22
[Download RAW message or body]

On Wed, 14 Jul 1999, pbrown@redhat.com wrote:
> What's the best way to make a widget a drop target without inheriting it
> and overriding dragEnterEvent() and dropEvent()?  The way I have come up
> with (untested, as of yet, because I want to see if there are better ways)
> is to call setAcceptDrops(true) for the widget, and then install an event
> filter on that widget monitoring for DragEnter and Drop events.  This is
> the only way I can see getting some drag and drop stuff going for a widget
> without inheritance.  Am I right?

Yes, and IMO it's a pretty clean solution as well. Eventfilters are a very
powerful concept (though still quite unknown among Qt programmers).

Matthias


> 
> ---
>   Preston Brown                                    Systems Engineer
>   pbrown@redhat.com                                Red Hat, Inc.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic