mirror of
https://github.com/leozide/leocad
synced 2024-11-17 07:47:55 +01:00
Faster timeline selection updates.
This commit is contained in:
parent
434ace6862
commit
8fab83f2f0
1 changed files with 10 additions and 2 deletions
|
@ -231,7 +231,7 @@ void lcTimelineWidget::UpdateSelection()
|
|||
if (mIgnoreUpdates)
|
||||
return;
|
||||
|
||||
bool Blocked = blockSignals(true);
|
||||
QItemSelection ItemSelection;
|
||||
|
||||
for (int TopLevelItemIdx = 0; TopLevelItemIdx < topLevelItemCount(); TopLevelItemIdx++)
|
||||
{
|
||||
|
@ -242,10 +242,18 @@ void lcTimelineWidget::UpdateSelection()
|
|||
QTreeWidgetItem* PieceItem = StepItem->child(PieceItemIdx);
|
||||
lcPiece* Piece = (lcPiece*)PieceItem->data(0, Qt::UserRole).value<uintptr_t>();
|
||||
|
||||
PieceItem->setSelected(Piece->IsSelected());
|
||||
if (Piece->IsSelected())
|
||||
{
|
||||
QModelIndex Index = indexFromItem(PieceItem);
|
||||
ItemSelection.select(Index, Index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool Blocked = blockSignals(true);
|
||||
|
||||
selectionModel()->select(ItemSelection, QItemSelectionModel::ClearAndSelect);
|
||||
|
||||
blockSignals(Blocked);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue