UI: Resize SceneTree after dropEvent

Calling resizeEvent for SceneTree after a dropEvent has occurred
prevents a dropped item from being displayed in the incorrect location
while in Grid Mode. There might be a better way to fix the incorrectly
displayed location of a dropped item, but we already do this in
SetGridMode and rowsInserted, so this is probably okay.
master
Ryan Foster 2022-08-28 00:17:09 -04:00 committed by Georges Basile Stavracas Neto
parent 1eebf27e9e
commit fd0c4b7d09
1 changed files with 5 additions and 0 deletions

View File

@ -143,6 +143,11 @@ void SceneTree::dropEvent(QDropEvent *event)
QListWidget::dropEvent(event);
// We must call resizeEvent to correctly place all grid items.
// We also do this in rowsInserted.
QResizeEvent resEvent(size(), size());
SceneTree::resizeEvent(&resEvent);
QTimer::singleShot(100, [this]() { emit scenesReordered(); });
}