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

Method scrollTo

launcher/ui/instanceview/InstanceView.cpp:1019–1032  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1017}
1018
1019void InstanceView::scrollTo(const QModelIndex &index, ScrollHint hint)
1020{
1021 if (!index.isValid())
1022 return;
1023
1024 const QRect rect = visualRect(index);
1025 if (hint == EnsureVisible && viewport()->rect().contains(rect))
1026 {
1027 viewport()->update(rect);
1028 return;
1029 }
1030
1031 verticalScrollBar()->setValue(verticalScrollToValue(index, rect, hint));
1032}
1033
1034int InstanceView::verticalScrollToValue(const QModelIndex &index, const QRect &rect, QListView::ScrollHint hint) const
1035{

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