mirror of
https://github.com/miek/inspectrum.git
synced 2026-03-06 00:14:20 +01:00
Add debug timer for paintEvent
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#include "spectrogram.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QElapsedTimer>
|
||||
#include <QPainter>
|
||||
#include <QPaintEvent>
|
||||
#include <QRect>
|
||||
@@ -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";
|
||||
}
|
||||
Reference in New Issue
Block a user