From 132a333e3804d7a50daa048a6ee3cbb648c1b126 Mon Sep 17 00:00:00 2001 From: Maya Posch Date: Wed, 10 Nov 2021 18:01:04 +0100 Subject: [PATCH] Use QScroller to provide primary mouse/touch input-based scrolling. --- player/NymphCastPlayer/mainwindow.cpp | 5 +++++ player/NymphCastPlayer/mainwindow.ui | 15 +++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/player/NymphCastPlayer/mainwindow.cpp b/player/NymphCastPlayer/mainwindow.cpp index 3b21070b..17cff8b9 100644 --- a/player/NymphCastPlayer/mainwindow.cpp +++ b/player/NymphCastPlayer/mainwindow.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include "remotes.h" @@ -210,6 +211,10 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainW // Set values. ui->sharesTreeView->setModel(&sharesModel); + // Set QScroller on the list view and similar that need touch-based scrolling support. + QScroller::grabGesture(ui->mediaListWidget, QScroller::LeftMouseButtonGesture); + QScroller::grabGesture(ui->sharesTreeView, QScroller::LeftMouseButtonGesture); + // Ensure this path exists. QDir dir(appDataLocation); if (!dir.exists()) { diff --git a/player/NymphCastPlayer/mainwindow.ui b/player/NymphCastPlayer/mainwindow.ui index 20705689..da161c63 100644 --- a/player/NymphCastPlayer/mainwindow.ui +++ b/player/NymphCastPlayer/mainwindow.ui @@ -164,7 +164,14 @@ 0 - + + + QAbstractItemView::ScrollPerPixel + + + QAbstractItemView::ScrollPerPixel + + @@ -473,7 +480,11 @@ - + + + QAbstractItemView::ScrollPerPixel + +