]> git.sesse.net Git - pkanalytics/commitdiff
Make a hotkey for getting the video unstuck when Qt messes up.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 11 May 2023 15:30:59 +0000 (17:30 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 11 May 2023 15:30:59 +0000 (17:30 +0200)
main.cpp

index 0a6819b2d3587396e7a4f563df4d34c12f23c5a9..4383f2e84958bc1dbfc06c6c72f58e9a959cba36 100644 (file)
--- 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); });