From 6e58f94a489c5260c01521fddf1893088bec8d05 Mon Sep 17 00:00:00 2001 From: Tats Date: Sat, 26 Apr 2014 01:01:44 +0100 Subject: [PATCH] Simple "hack" with a QTimer to time the video --- MainWindow.cpp | 5 +++++ MainWindow.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/MainWindow.cpp b/MainWindow.cpp index 48e8e6a..344861d 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -42,6 +42,11 @@ MainWindow::MainWindow() _hasCurrentPaint = false; _hasCurrentMapping = false; + videoTimer = new QTimer(this); + videoTimer->setInterval(1000/30); + connect(videoTimer, SIGNAL(timeout()), this, SLOT(updateAll())); + videoTimer->start(); + createLayout(); createActions(); diff --git a/MainWindow.h b/MainWindow.h index b1282cc..5fd8f97 100644 --- a/MainWindow.h +++ b/MainWindow.h @@ -234,6 +234,8 @@ private: bool _hasCurrentMapping; bool _hasCurrentPaint; + QTimer *videoTimer; + static MainWindow* instance; public: @@ -265,7 +267,6 @@ public: public slots: void updateAll(); - public: // Constants. static const int DEFAULT_WIDTH = 1600;