select instance after joining world from all worlds screen

This commit is contained in:
Ice Yeti 2026-06-12 13:27:22 -04:00
parent 2e656c247b
commit 1c1717a8ea
6 changed files with 33 additions and 5 deletions

View file

@ -207,6 +207,24 @@ void InstanceView::updateGeometries()
viewport()->update();
}
void InstanceView::selectInstance(BaseInstance* instance)
{
QModelIndex index;
for (int row = 0; row < model()->rowCount(); row++) {
for (int j = 0; j < model()->columnCount(); j++) {
auto testIndex = model()->index(row, j);
if (testIndex.data(InstanceList::InstanceIDRole).toString() == instance->id()) {
index = testIndex;
}
}
}
if (index.isValid()) {
selectionModel()->setCurrentIndex(index, QItemSelectionModel::ClearAndSelect);
}
}
bool InstanceView::isIndexHidden(const QModelIndex& index) const
{
VisualGroup* cat = category(index);