MrGarbage
21st September 2007, 20:53
Hi,
I am implementing a Drag and Drop of some LED objects.
These are embedded in some layouts which are part of a config class where
I am implementing the dragEnterEvent(), etc.
Im my LED objects' mousePressEvent() I setup QMimeData such that in my
config class dropEvent() I successfully decode the mime data that I passed in.
So I have all of the info about the source widget...
The problem is that I need some information about the target widget in
order to determine if I will actually allow the drop and what to do
with the source mime data.
There doesn't seem to be a way to find the target widget.
I have event->pos but I don't seem to be able to get this to
map to the widget where I am dropping.
This seems like it should do it, but the result is not the target object.
DraggableLED *child = static_cast<DraggableLED*>(childAt(event->pos()));
Many thanks
Mark
I am implementing a Drag and Drop of some LED objects.
These are embedded in some layouts which are part of a config class where
I am implementing the dragEnterEvent(), etc.
Im my LED objects' mousePressEvent() I setup QMimeData such that in my
config class dropEvent() I successfully decode the mime data that I passed in.
So I have all of the info about the source widget...
The problem is that I need some information about the target widget in
order to determine if I will actually allow the drop and what to do
with the source mime data.
There doesn't seem to be a way to find the target widget.
I have event->pos but I don't seem to be able to get this to
map to the widget where I am dropping.
This seems like it should do it, but the result is not the target object.
DraggableLED *child = static_cast<DraggableLED*>(childAt(event->pos()));
Many thanks
Mark