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

Method scrollTo

launcher/ui/instanceview/InstanceView.cpp:971–984  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

969}
970
971void InstanceView::scrollTo(const QModelIndex &index, ScrollHint hint)
972{
973 if (!index.isValid())
974 return;
975
976 const QRect rect = visualRect(index);
977 if (hint == EnsureVisible && viewport()->rect().contains(rect))
978 {
979 viewport()->update(rect);
980 return;
981 }
982
983 verticalScrollBar()->setValue(verticalScrollToValue(index, rect, hint));
984}
985
986int InstanceView::verticalScrollToValue(const QModelIndex &index, const QRect &rect, QListView::ScrollHint hint) const
987{

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