]> git.sesse.net Git - pkanalytics/blobdiff - main.cpp
Make the events view scroll the current event into view when playing.
[pkanalytics] / main.cpp
index 104e1e5875dc23e20efe217ea17b5ee5cad69d95..faac256aa15818cbccd280ca6fd991342b29208b 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -161,6 +161,10 @@ void MainWindow::position_changed(uint64_t pos)
        if (!playing) {
                video->pause();  // We only played to get a picture.
        }
+       if (playing) {
+               QModelIndex row = events->get_last_event_qt(video->position());
+               ui->event_view->scrollTo(row, QAbstractItemView::PositionAtCenter);
+       }
        update_ui_from_time(pos);
 }