aboutsummaryrefslogtreecommitdiff
path: root/app/draw.cpp
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2020-08-14 20:30:07 +0200
committerJulian T <julian@jtle.dk>2020-09-16 21:05:58 +0200
commit9b34ab6db773568011dc85fd73156b63da377e01 (patch)
tree2511b89ecdf948826e51d342610635b7e8dfbf33 /app/draw.cpp
parent5ca04e5b2ec8eef88df6cbd4e3d09ac7dab55c0d (diff)
Better configuration
Diffstat (limited to 'app/draw.cpp')
-rw-r--r--app/draw.cpp9
1 files changed, 4 insertions, 5 deletions
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 <qwindowdefs.h>
#include <iostream>
-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*) {