From kde-core-devel Wed Jul 14 15:29:14 1999 From: "Dirk A. Mueller" Date: Wed, 14 Jul 1999 15:29:14 +0000 To: kde-core-devel Subject: Re: drag and drop proxy object X-MARC-Message: https://marc.info/?l=kde-core-devel&m=93196821016650 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