From 5ff014458695859fb856b0bdb48a1cc0bcee320a Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Thu, 11 May 2023 17:30:59 +0200 Subject: [PATCH] Make a hotkey for getting the video unstuck when Qt messes up. --- main.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/main.cpp b/main.cpp index 0a6819b..4383f2e 100644 --- a/main.cpp +++ b/main.cpp @@ -75,6 +75,17 @@ MainWindow::MainWindow(EventsModel *events, PlayersModel *players) : events(even QShortcut *pgup = new QShortcut(QKeySequence(Qt::Key_PageUp), this); connect(pgup, &QShortcut::activated, [this]() { seek(120000); }); + // Ugh. Used when Qt messes up and hangs the video. + QShortcut *f5 = new QShortcut(QKeySequence(Qt::Key_F5), this); + connect(f5, &QShortcut::activated, [this]() { + QVideoWidget *nvw = new QVideoWidget(ui->video->parentWidget()); + nvw->setObjectName("video"); + nvw->setMinimumSize(QSize(320, 240)); + video->setVideoOutput(nvw); + ui->main_grid->replaceWidget(ui->video, nvw); + ui->video = nvw; + }); + connect(ui->minus10s, &QPushButton::clicked, [this]() { seek(-10000); }); connect(ui->plus10s, &QPushButton::clicked, [this]() { seek(10000); }); -- 2.39.2