viewer: began waveformview widget
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user