From: Steinar H. Gunderson Date: Thu, 11 May 2023 15:30:59 +0000 (+0200) Subject: Make a hotkey for getting the video unstuck when Qt messes up. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=5ff014458695859fb856b0bdb48a1cc0bcee320a;p=pkanalytics Make a hotkey for getting the video unstuck when Qt messes up. --- 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); });