DropTarget

Makes a widget, with every child that does not take drops itself, one drop area, and lights it up while an acceptable drag is over it.

Inherits QObject

Declared in src/libs/libwidgets/components/DropTarget.hpp.

Detailed description

Whoever owns the widget decides what a drop MEANS; this only makes the area big and says, visibly, that a drop is welcome. accepts answers "is this drag acceptable?", take receives the drop.

A child that handles its own drops (a text edit, say) keeps them. Pass it to watch() and a drag over it lights the whole target too, without taking its drop away.

The highlight is an accent border drawn over the target, transparent to the mouse, so it never takes a drop or a click itself.

Made for OPAL's chat (owner, 2026-09-27: "technically I am dropping it into OPAL, the whole widget"; opal-chat-surface §OCSD-11), and reusable for any panel that takes files.

In this section