mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-07-01 02:46:59 +03:00
select instance after joining world from all worlds screen
This commit is contained in:
parent
2e656c247b
commit
1c1717a8ea
6 changed files with 33 additions and 5 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue