From 41ea2d8f94043d49fc26aaaa8030a73dcfdc2da9 Mon Sep 17 00:00:00 2001 From: Julian T Date: Sun, 24 Jan 2021 18:13:44 +0100 Subject: Create rust project --- app/draw.cpp | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 app/draw.cpp (limited to 'app/draw.cpp') diff --git a/app/draw.cpp b/app/draw.cpp deleted file mode 100644 index 88733ef..0000000 --- a/app/draw.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "draw.hpp" -#include -#include -#include -#include -#include -#include -#include -#include - -DrawWidget::DrawWidget(const Config &conf) : - QWidget(), m_conf(conf) { - m_drawbuffer = new QRgb[conf.m_width * conf.m_height]; - - m_img = QImage((uchar*)m_drawbuffer, conf.m_width, conf.m_height, QImage::Format_ARGB32); - -} - -void DrawWidget::paintEvent(QPaintEvent*) { - QPainter painter(this); - - auto scaled = m_img.scaled(width(), height(), Qt::KeepAspectRatio); - painter.drawImage(0, 0, scaled); -} - -void DrawWidget::redraw() { - repaint(); -} - -DrawWidget::~DrawWidget() { - delete[] m_drawbuffer; -} -- cgit v1.2.3