MCPcopy Create free account
hub / github.com/MultiMC/Launcher / scrollTo

Method scrollTo

launcher/ui/instanceview/InstanceView.cpp:980–993  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

978}
979
980void InstanceView::scrollTo(const QModelIndex &index, ScrollHint hint)
981{
982 if (!index.isValid())
983 return;
984
985 const QRect rect = visualRect(index);
986 if (hint == EnsureVisible && viewport()->rect().contains(rect))
987 {
988 viewport()->update(rect);
989 return;
990 }
991
992 verticalScrollBar()->setValue(verticalScrollToValue(index, rect, hint));
993}
994
995int InstanceView::verticalScrollToValue(const QModelIndex &index, const QRect &rect, QListView::ScrollHint hint) const
996{

Callers 3

selectCurrentMethod · 0.80
selectRecommendedMethod · 0.80
delayed_scrollMethod · 0.80

Calls 4

rectMethod · 0.80
isValidMethod · 0.45
containsMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected