diff options
author | Julian T <julian@jtle.dk> | 2020-08-14 20:30:07 +0200 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2020-09-16 21:05:58 +0200 |
commit | 9b34ab6db773568011dc85fd73156b63da377e01 (patch) | |
tree | 2511b89ecdf948826e51d342610635b7e8dfbf33 /app/draw.cpp | |
parent | 5ca04e5b2ec8eef88df6cbd4e3d09ac7dab55c0d (diff) |
Better configuration
Diffstat (limited to 'app/draw.cpp')
-rw-r--r-- | app/draw.cpp | 9 |
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*) { |