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

List:       kde-core-devel
Subject:    Re: drag and drop proxy object
From:       "Dirk A. Mueller" <dmuell () gmx ! net>
Date:       1999-07-14 15:29:14
[Download RAW message or body]

<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.

I also had that problem. I thought that one of the parent widgets that
is already inherited could use setAcceptDrops(true) and checks in the
dragMoveEvent() whether the thing is just above the child widget that
should accept it and calls then event->accept(true), else
event->accept(false).

I havn't tested it, but it should work, I've seen this in the Qt
source itself (QMultilineEdit?). It isn't very elegant, I know. But I
can't think of a better solution. Why did TT used virtual methods for
this when they could use signals and slots?


-- 
Dirk A. Mueller

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

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