MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / preselect

Method preselect

launcher/ui/pages/instance/VersionPage.cpp:625–642  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

623}
624
625void VersionPage::preselect(int row)
626{
627 if(row < 0)
628 {
629 row = 0;
630 }
631 if(row >= m_profile->rowCount(QModelIndex()))
632 {
633 row = m_profile->rowCount(QModelIndex()) - 1;
634 }
635 if(row < 0)
636 {
637 return;
638 }
639 auto model_index = m_profile->index(row);
640 ui->packageView->selectionModel()->select(model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
641 updateButtons(row);
642}
643
644void VersionPage::onGameUpdateError(QString error)
645{

Callers

nothing calls this directly

Calls 3

QModelIndexClass · 0.85
rowCountMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected