Ignore invalid drop in timeline
Fixes #972 In the timeline widget, if a piece is dropped beyond the last step, it will disappear from the model. Ignore these invalid drag and drops.
This commit is contained in:
@@ -567,14 +567,14 @@ void lcTimelineWidget::dropEvent(QDropEvent* Event)
|
||||
QList<QTreeWidgetItem*> SelectedItems = selectedItems();
|
||||
clearSelection();
|
||||
|
||||
if (DropItem)
|
||||
{
|
||||
QTreeWidgetItem* ParentItem = DropItem->parent();
|
||||
lcStep Step = indexOfTopLevelItem(ParentItem ? ParentItem : DropItem) + 1;
|
||||
if (!DropItem)
|
||||
return;
|
||||
|
||||
if (Step > Model->GetCurrentStep())
|
||||
Model->SetCurrentStep(Step);
|
||||
}
|
||||
QTreeWidgetItem* ParentItem = DropItem->parent();
|
||||
lcStep Step = indexOfTopLevelItem(ParentItem ? ParentItem : DropItem) + 1;
|
||||
|
||||
if (Step > Model->GetCurrentStep())
|
||||
Model->SetCurrentStep(Step);
|
||||
|
||||
auto SortItems = [this](QTreeWidgetItem* Item1, QTreeWidgetItem* Item2)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user