viewer: began waveformview widget

This commit is contained in:
itsmattkc
2020-03-13 16:02:18 +11:00
parent e2fe9ad548
commit 0418c8ab85
5 changed files with 46 additions and 4 deletions
+24
View File
@@ -0,0 +1,24 @@
#include "waveformview.h"
#include <QPainter>
#include <QtMath>
WaveformView::WaveformView(QWidget *parent) :
TimeBasedWidget(parent)
{
setAutoFillBackground(true);
setStyleSheet("background: black;");
}
void WaveformView::paintEvent(QPaintEvent *event)
{
QWidget::paintEvent(event);
QPainter p(this);
p.setPen(Qt::green);
for (int i=0;i<width();i++) {
p.drawPoint(i, (height() / 2) + qSin(static_cast<double>(i) * 0.025) * (height() / 2));
}
}