From 9b34ab6db773568011dc85fd73156b63da377e01 Mon Sep 17 00:00:00 2001 From: Julian T Date: Fri, 14 Aug 2020 20:30:07 +0200 Subject: Better configuration --- app/draw.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'app/draw.cpp') diff --git a/app/draw.cpp b/app/draw.cpp index b3187be..6cbc338 100644 --- a/app/draw.cpp +++ b/app/draw.cpp @@ -7,12 +7,11 @@ #include #include -DrawWidget::DrawWidget(unsigned width, unsigned height) : QWidget() { - m_width = width; - m_height = height; - m_drawbuffer = new QRgb[width * height]; +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, width, height, QImage::Format_ARGB32); + m_img = QImage((uchar*)m_drawbuffer, conf.m_width, conf.m_height, QImage::Format_ARGB32); } void DrawWidget::paintEvent(QPaintEvent*) { -- cgit v1.2.3