I have a strange behavior when calling void ItemBox::endDrop(bool _reset) an exception is raised because my ItemBox widget and its childs seems to have disappeared...
I've looked into the function and when I comment this line
mReseiverContainer = nullptr;
It doesn't crash anymore, but, of course, drag and drop is not working
Sorry, ItemBox not DDContainer.
I've found the bug.
Here is the scenario:
1/ I receive a ItemBox drag event and returned result is true
2/ I receive a drop event and returned result is true
3/ But before eventRequestDrop(this, mDropInfo, mDropResult) returned, a call to reset_drag() is made.
When you look at the code
void DDContainer::mouseDrag(MouseButton _id)
// делаем запрос на индекс по произвольному виджету
receiver = item->_getContainer();
// работаем только с контейнерами
if (receiver && receiver->isType<DDContainer>())
eventRequestDrop(this, mDropInfo, mDropResult); <--------------- Drop event sent, endDrop() called before event returned
// устанавливаем новую подсветку
mReseiverContainer->_setContainerItemInfo(mDropInfo.receiver_index, true, mDropResult); <------------------------- then mReseiverContainer is null
eventRequestDrop is request for you, and it asks if that container accept drop or not. You should not change container when it ask how to draw something. If you really need to reset drag when you move mouse over some widget call resetDrag not inside this request.