Fix selecting component by part id
parent
19748816fe
commit
78893729b4
|
@ -126,6 +126,7 @@ void PartManageWidget::selectComponentByPartId(const dust3d::Uuid &partId)
|
||||||
QModelIndex index = m_componentPreviewGridWidget->componentListModel()->componentIdToIndex(componentId);
|
QModelIndex index = m_componentPreviewGridWidget->componentListModel()->componentIdToIndex(componentId);
|
||||||
if (index.isValid()) {
|
if (index.isValid()) {
|
||||||
m_componentPreviewGridWidget->selectionModel()->select(index, QItemSelectionModel::ClearAndSelect);
|
m_componentPreviewGridWidget->selectionModel()->select(index, QItemSelectionModel::ClearAndSelect);
|
||||||
|
m_componentPreviewGridWidget->scrollTo(index);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const auto &component = m_document->findComponent(componentId);
|
const auto &component = m_document->findComponent(componentId);
|
||||||
|
@ -135,6 +136,7 @@ void PartManageWidget::selectComponentByPartId(const dust3d::Uuid &partId)
|
||||||
index = m_componentPreviewGridWidget->componentListModel()->componentIdToIndex(componentId);
|
index = m_componentPreviewGridWidget->componentListModel()->componentIdToIndex(componentId);
|
||||||
if (index.isValid()) {
|
if (index.isValid()) {
|
||||||
m_componentPreviewGridWidget->selectionModel()->select(index, QItemSelectionModel::ClearAndSelect);
|
m_componentPreviewGridWidget->selectionModel()->select(index, QItemSelectionModel::ClearAndSelect);
|
||||||
|
m_componentPreviewGridWidget->scrollTo(index);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dust3dDebug << "Unable to select component:" << componentId.toString();
|
dust3dDebug << "Unable to select component:" << componentId.toString();
|
||||||
|
|
Loading…
Reference in New Issue