From 2591f6bdfb5d8662552b92e6e41bc1e11fec7588 Mon Sep 17 00:00:00 2001 From: Mike Walters Date: Mon, 13 Jul 2015 00:42:35 +0100 Subject: [PATCH] Add debug timer for paintEvent --- spectrogram.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spectrogram.cpp b/spectrogram.cpp index 0581e0c..2a03a7a 100644 --- a/spectrogram.cpp +++ b/spectrogram.cpp @@ -1,5 +1,7 @@ #include "spectrogram.h" +#include +#include #include #include #include @@ -17,6 +19,9 @@ Spectrogram::~Spectrogram() void Spectrogram::paintEvent(QPaintEvent *event) { + QElapsedTimer timer; + timer.start(); + QRect rect = event->rect(); QPainter painter(this); painter.fillRect(rect, Qt::black); @@ -42,4 +47,6 @@ void Spectrogram::paintEvent(QPaintEvent *event) free(data); } + + qDebug() << "Paint: " << timer.elapsed() << "ms"; } \ No newline at end of file