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
parent
1eebf27e9e
commit
fd0c4b7d09
|
@ -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(); });
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue